当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
2 Star 0 Fork 1

JUMEI_ARCH/go-plugins
暂停

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
noop.go 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
Asim Aslam 提交于 2018-02-19 20:53 . add options method
// Package noop is a registry which does nothing
package noop
import (
"github.com/micro/go-micro/cmd"
"github.com/micro/go-micro/registry"
)
type noopRegistry struct {
options registry.Options
}
func init() {
cmd.DefaultRegistries["noop"] = NewRegistry
}
func (m *noopRegistry) Options() registry.Options {
return m.options
}
func (m *noopRegistry) GetService(service string) ([]*registry.Service, error) {
return nil, nil
}
func (m *noopRegistry) ListServices() ([]*registry.Service, error) {
return nil, nil
}
func (m *noopRegistry) Register(s *registry.Service, opts ...registry.RegisterOption) error {
return nil
}
func (m *noopRegistry) Deregister(s *registry.Service) error {
return nil
}
func (m *noopRegistry) Watch(opts ...registry.WatchOption) (registry.Watcher, error) {
return &noopWatcher{exit: make(chan bool)}, nil
}
func (m *noopRegistry) String() string {
return "noop"
}
func NewRegistry(opts ...registry.Option) registry.Registry {
var options registry.Options
for _, o := range opts {
o(&options)
}
return &noopRegistry{options}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/JMArch/go-plugins.git
git@gitee.com:JMArch/go-plugins.git
JMArch
go-plugins
go-plugins
v0.9.0

搜索帮助