nacos

package
v0.0.0-...-4a57dfb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// "serverConfigs" + "clientConfig"
	Configs config_client.IConfigClient
	// Listener List. example: map["namespace_name/group_name/dataID_name]struct{})
	Listeners map[string]struct{}
	// cycle time interval, second
	NacosInterval int
	ExitWatchCh   chan error
}

func NewNacosClient

func NewNacosClient(
	backendNodes []string,
	password,
	username,
	namespace,
	accessKey,
	secretKey string,
	nacosInterval int,
) (c *Client, err error)

NewNacosClient create nacod client

func (*Client) GetValues

func (c *Client) GetValues(keys []string) (map[string]string, error)

GetValues get all dataID in this namespace

func (*Client) WatchPrefix

func (c *Client) WatchPrefix(prefix string, keys []string, waitIndex uint64, stopChan chan bool) (uint64, error)

WatchPrefix watch all namespace if creat new dataID, perhaps delay 60S @prefix @keys will no useful

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL