微服务框架

fancl 8bba61a314 修改数据上报接口 2 years ago
.vscode 6d0daf3d0f 添加机器码 2 years ago
broker 9e30db74c4 优化服务接口 2 years ago
cmd 8bba61a314 修改数据上报接口 2 years ago
gateway 8bba61a314 修改数据上报接口 2 years ago
helper 8bba61a314 修改数据上报接口 2 years ago
log 9e30db74c4 优化服务接口 2 years ago
registry ae2b2c050a 修复select获取到的服务可能不可用的情况 2 years ago
stats deb58152c1 add prometheus stats 2 years ago
sync deb58152c1 add prometheus stats 2 years ago
vendor 299929e8ee HTTP新增对serverHttp Hook操作 2 years ago
.gitignore 8bba61a314 修改数据上报接口 2 years ago
README.md 1ef67231d2 添加README 3 years ago
client.go 08465bb774 rpc请求服务端添加重试处理 2 years ago
context.go 1b38da8010 remove depend 3 years ago
global.go e9be5a2951 处理微服务组件支持全局注册方式 2 years ago
go.mod 299929e8ee HTTP新增对serverHttp Hook操作 2 years ago
go.sum 299929e8ee HTTP新增对serverHttp Hook操作 2 years ago
micro.go fb25a01734 修复组件BUG 2 years ago
options.go 8bba61a314 修改数据上报接口 2 years ago
options_test.go 6d0daf3d0f 添加机器码 2 years ago
reporter.go 8bba61a314 修改数据上报接口 2 years ago
reporter_test.go 418ed96554 修复darwin获取机器码出问题 2 years ago
request.go af3a5e48d2 fix log bug 2 years ago
response.go 1b38da8010 remove depend 3 years ago
service.go 8bba61a314 修改数据上报接口 2 years ago

README.md

提供基本的服务框架

使用示例:

import (
	"git.nspix.com/golang/micro"
	"git.nspix.com/golang/micro/gateway"
	"git.nspix.com/golang/micro/log"
)

func main() {
	svr := micro.New(micro.WithName("test", "0.1.01"))

	svr.Handle("math.add", func(ctx gateway.Context) (err error) {
		return ctx.Success(100)
	})

	log.Debug(svr.Run())
}