Documentation ¶
Overview ¶
Package nacoscli provides for getting the configuration from the nacos configuration center and parse it into a structure.
Index ¶
- func GetAndWatchConfig(client config_client.IConfigClient, dataId, group, configType string, ...) error
- func Init(obj interface{}, params *Params, opts ...Option) error
- func NewClient(url, namespace string, port uint64) (config_client.IConfigClient, error)
- func NewNamingClient(nacosIPAddr string, nacosPort int, nacosNamespaceID string, opts ...Option) (naming_client.INamingClient, error)
- type Option
- type Params
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAndWatchConfig ¶
func GetAndWatchConfig(client config_client.IConfigClient, dataId, group, configType string, config interface{}) error
func NewClient ¶
func NewClient(url, namespace string, port uint64) (config_client.IConfigClient, error)
func NewNamingClient ¶
func NewNamingClient(nacosIPAddr string, nacosPort int, nacosNamespaceID string, opts ...Option) (naming_client.INamingClient, error)
NewNamingClient create a service registration and discovery of nacos client
Types ¶
type Option ¶
type Option func(*options)
Option set the nacos client options.
func WithClientConfig ¶
func WithClientConfig(clientConfig *constant.ClientConfig) Option
WithClientConfig set nacos client config
func WithServerConfigs ¶
func WithServerConfigs(serverConfigs []constant.ServerConfig) Option
WithServerConfigs set nacos server config
type Params ¶
type Params struct { IPAddr string // server address Port uint64 // port Scheme string // http or https ContextPath string // path NamespaceID string // namespace id Group string // group, example: dev, prod, test DataID string // config file id Format string // configuration file type: json,yaml,toml // contains filtered or unexported fields }
Params nacos parameters
Click to show internal directories.
Click to hide internal directories.