Discover Packages
github.com/kuangrenxuezhe/autoservice
command
module
Version:
v1.0.1
Opens a new window with list of versions in this module.
Published: Feb 9, 2021
License: Apache-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
一、autoservice
自动化服务框架,服务端支持http及grpc协议,使用中间技术,增加APM性能。减少服务开发时间。
二、服务配置
[grpc]
enabled = true
host = "0.0.0.0:50051"
maxconcurrency = 10240
readtimeout = 300
writetimeout = 3000
[http]
enabled = true
host = "0.0.0.0:8888"
maxconcurrency = 10240
readtimeout = 300
writetimeout = 3000
[[locations]]
location = "/v1/static/*filepath"
module = "static.lands"
[[locations]]
location = "/v1/classify"
module = "classify.lands"
[logfunc]
path = "./configs/funclog.toml"
[logsys]
path = "./configs/log.toml"
[[modules]]
conf = "./configs/static.ini"
name = "static.lands"
[[modules]]
conf = "./configs/classify.ini"
name = "classify.lands"
[pprof]
enabled = true
port = 8886
三、中间件
opentracing(链路性能)
pprof(golang 监控)
prometheus (性能监控)
recovery (故障恢复)
logger (自动日志)
lru(缓存)
redis
apollo
四、服务接口
type Plugin interface {
// Init initialize plugin with specified configuration.
// If error occurs in initialization, don't return, just PANIC!
Init(conf string)
// Serve http request
ServeHTTP(ctx *gin.Context)
// Serve http for debug online
Debug(ctx *gin.Context)
// serve gprc request
RegisterGrpcService(s *grpc.Server)
}
Expand ▾
Collapse ▴
Documentation
¶
Copyright © 2020 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Source Files
¶
Directories
¶
pkg
Click to show internal directories.
Click to hide internal directories.