Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Discovery ¶ added in v0.10.0
type Discovery struct {
// contains filtered or unexported fields
}
Discovery implements service discovery using Nacos.
func NewNacosServiceDiscovery ¶ added in v0.4.0
NewNacosServiceDiscovery creates a new NacosServiceDiscovery instance.
func (*Discovery) Close ¶ added in v0.10.0
Close stops the Nacos service discovery and cleans up resources.
func (*Discovery) GetInstances ¶ added in v0.10.0
func (d *Discovery) GetInstances( _ context.Context, options provider.GetInstanceOptions, ) ([]provider.Instancer, error)
GetInstances returns the current list of healthy service instances from Nacos.
type Options ¶
type Options struct {
Username string
Password string
NamespaceID string
Prefix string
LogDir string
LogLevel string // debug, info, warn, error
CacheDir string
Endpoints []string
Files []*File
Timeout time.Duration
Watch bool
}
Options defines the configuration for the Nacos configuration provider.
type Provider ¶ added in v0.10.0
type Provider struct {
OnChanged provider.ChangeFunc
// contains filtered or unexported fields
}
Provider implements a configuration provider that reads from Nacos.
func NewProvider ¶
NewProvider creates a new NacosProvider instance.
func (*Provider) ConfigOpen ¶ added in v0.10.0
ConfigOpen reads the configured files from Nacos and returns their content.
func (*Provider) SetOnChanged ¶ added in v0.10.0
func (p *Provider) SetOnChanged(changeFunc provider.ChangeFunc)
SetOnChanged sets the callback function to be called when configuration changes in Nacos.
Click to show internal directories.
Click to hide internal directories.