Documentation ¶
Index ¶
- type Config
- type Handler
- func (p *Handler) DiscoverServices(name string) ([]Service, error)
- func (p *Handler) Get(key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error)
- func (p *Handler) Put(key, value string, opts ...clientv3.OpOption) (*clientv3.PutResponse, error)
- func (p *Handler) RegisterService(name string, address string, port int) error
- func (p *Handler) RegisterServiceDefault() error
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Name string Address string Port int Endpoints []string `yaml:"endpoints"` AutoSyncInterval time.Duration `yaml:"autoSyncInterval"` DialTimeout time.Duration `yaml:"dialTimeout"` // 秒 DefLeaseSecond time.Duration `yaml:"defLeaseSecond"` // 续租时间(秒) DialKeepAliveTime time.Duration `yaml:"dialKeepAliveTime"` DialKeepAliveTimeout time.Duration `yaml:"dialKeepAliveTimeout"` }
123
type Handler ¶
func (*Handler) DiscoverServices ¶
DiscoverServices 发现服务
func (*Handler) RegisterService ¶
RegisterService 注册服务
func (*Handler) RegisterServiceDefault ¶
RegisterServiceDefault 注册服务默认配置
Click to show internal directories.
Click to hide internal directories.