Documentation ¶
Index ¶
- func NewNacosDiscovery(servicePath, cluster, group string, clientConfig constant.ClientConfig, ...) (client.ServiceDiscovery, error)
- func NewNacosDiscoveryWithClient(servicePath, cluster, group string, namingClient naming_client.INamingClient) client.ServiceDiscovery
- type NacosDiscovery
- func (d *NacosDiscovery) Clone(servicePath string) (client.ServiceDiscovery, error)
- func (d *NacosDiscovery) Close()
- func (d *NacosDiscovery) GetServices() []*client.KVPair
- func (d *NacosDiscovery) RemoveWatcher(ch chan []*client.KVPair)
- func (d *NacosDiscovery) SetFilter(filter client.ServiceDiscoveryFilter)
- func (d *NacosDiscovery) WatchService() chan []*client.KVPair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNacosDiscovery ¶
func NewNacosDiscovery(servicePath, cluster, group string, clientConfig constant.ClientConfig, serverConfig []constant.ServerConfig) (client.ServiceDiscovery, error)
NewNacosDiscovery returns a new NacosDiscovery.
func NewNacosDiscoveryWithClient ¶
func NewNacosDiscoveryWithClient(servicePath, cluster, group string, namingClient naming_client.INamingClient) client.ServiceDiscovery
Types ¶
type NacosDiscovery ¶
type NacosDiscovery struct { // nacos client config ClientConfig constant.ClientConfig // nacos server config ServerConfig []constant.ServerConfig Cluster string Group string RetriesAfterWatchFailed int // contains filtered or unexported fields }
NacosDiscovery is a nacos service discovery. It always returns the registered servers in nacos.
func (*NacosDiscovery) Clone ¶
func (d *NacosDiscovery) Clone(servicePath string) (client.ServiceDiscovery, error)
Clone clones this ServiceDiscovery with new servicePath.
func (*NacosDiscovery) Close ¶
func (d *NacosDiscovery) Close()
func (*NacosDiscovery) GetServices ¶
func (d *NacosDiscovery) GetServices() []*client.KVPair
GetServices returns the servers
func (*NacosDiscovery) RemoveWatcher ¶
func (d *NacosDiscovery) RemoveWatcher(ch chan []*client.KVPair)
func (*NacosDiscovery) SetFilter ¶
func (d *NacosDiscovery) SetFilter(filter client.ServiceDiscoveryFilter)
SetFilter sets the filer.
func (*NacosDiscovery) WatchService ¶
func (d *NacosDiscovery) WatchService() chan []*client.KVPair
WatchService returns a nil chan.
Click to show internal directories.
Click to hide internal directories.