1 Star 1 Fork 0

flash520/utils

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
nacos_client.go 1.78 KB
一键复制 编辑 原始数据 按行查看 历史
flash520 提交于 2021-06-29 10:13 . change: 使用 goImport 格式化代码
/**
* @Author: koulei
* @Description: TODO
* @File: namingClient
* @Version: 1.0.0
* @Date: 2021/5/11 22:46
*/
package nacos
import (
"fmt"
"github.com/nacos-group/nacos-sdk-go/model"
"github.com/nacos-group/nacos-sdk-go/vo"
)
func RegisterServiceInstance(param vo.RegisterInstanceParam) {
success, _ := namingClient.RegisterInstance(param)
fmt.Printf("RegisterServiceInstance,param:%+v,result:%+v \n\n", param, success)
}
func DeRegisterServiceInstance(param vo.DeregisterInstanceParam) {
success, _ := namingClient.DeregisterInstance(param)
fmt.Printf("DeRegisterServiceInstance,param:%+v,result:%+v \n\n", param, success)
}
func GetService(param vo.GetServiceParam) {
service, _ := namingClient.GetService(param)
fmt.Printf("GetService,param:%+v, result:%+v \n\n", param, service)
}
func SelectAllInstances(param vo.SelectAllInstancesParam) {
instances, _ := namingClient.SelectAllInstances(param)
fmt.Printf("SelectAllInstance,param:%+v, result:%+v \n\n", param, instances)
}
func SelectInstances(param vo.SelectInstancesParam) {
instances, _ := namingClient.SelectInstances(param)
fmt.Printf("SelectInstances,param:%+v, result:%+v \n\n", param, instances)
}
func SelectOneHealthyInstance(param vo.SelectOneHealthInstanceParam) *model.Instance {
instances, _ := namingClient.SelectOneHealthyInstance(param)
fmt.Printf("SelectInstances,param:%+v, result:%+v \n\n", param, instances)
return instances
}
func Subscribe(param *vo.SubscribeParam) {
_ = namingClient.Subscribe(param)
}
func UnSubscribe(param *vo.SubscribeParam) {
_ = namingClient.Unsubscribe(param)
}
func GetAllService(param vo.GetAllServiceInfoParam) model.ServiceList {
service, _ := namingClient.GetAllServicesInfo(param)
fmt.Printf("GetAllService,param:%+v, result:%+v \n\n", param, service)
return service
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/flash520/utils.git
git@gitee.com:flash520/utils.git
flash520
utils
utils
v1.1.2

搜索帮助