nacos

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GroupName = "DEFAULT_GROUP"
	Cluster   = "DEFAULT"
)

Variables

This section is empty.

Functions

func NewServerDiscovery

func NewServerDiscovery(option *Config) servicediscovery.IServiceDiscovery

func UseServiceDiscovery

func UseServiceDiscovery(serviceCollection *dependencyinjection.ServiceCollection)

Types

type Auth added in v1.6.6

type Auth struct {
	Enable   bool   `mapstructure:"enable" config:"enable"`
	User     string `mapstructure:"username" config:"username"`
	Password string `mapstructure:"password" config:"password"`
	// ACM Endpoint
	Endpoint string `mapstructure:"endpoint" config:"endpoint"`
	// ACM RegionId
	RegionId string `mapstructure:"regionId" config:"regionId"`
	// ACM AccessKey
	AccessKey string `mapstructure:"accessKey" config:"accessKey"`
	// ACM SecretKey
	SecretKey string `mapstructure:"secretKey" config:"secretKey"`
	// ACM OpenKMS
	OpenKMS bool `mapstructure:"openKMS" config:"openKMS"`
}

type Config

type Config struct {
	ENV         *abstractions.HostEnvironment
	Url         string `mapstructure:"url" config:"url"`
	Port        uint64 `mapstructure:"port" config:"port"`
	NamespaceId string `mapstructure:"namespace" config:"namespace"`
	GroupName   string `mapstructure:"group" config:"group"`
	Cluster     string `mapstructure:"cluster" config:"cluster"`
	Auth        *Auth  `mapstructure:"auth" config:"auth"`
}

type Registrar

type Registrar struct {
	// contains filtered or unexported fields
}

func (*Registrar) Destroy

func (registrar *Registrar) Destroy() error

func (*Registrar) GetAllInstances

func (registrar *Registrar) GetAllInstances(serviceName string) []servicediscovery.ServiceInstance

func (*Registrar) GetAllServices added in v1.6.6

func (registrar *Registrar) GetAllServices() ([]*servicediscovery.Service, error)

func (*Registrar) GetHealthyInstances

func (registrar *Registrar) GetHealthyInstances(serviceName string) []servicediscovery.ServiceInstance

func (Registrar) GetName

func (registrar Registrar) GetName() string

func (*Registrar) Register

func (registrar *Registrar) Register() error

func (*Registrar) Unregister

func (registrar *Registrar) Unregister() error

func (*Registrar) Update

func (registrar *Registrar) Update() error

func (*Registrar) Watch added in v1.6.6

func (registrar *Registrar) Watch(opts ...servicediscovery.WatchOption) (servicediscovery.Watcher, error)

type Watcher added in v1.6.6

type Watcher struct {
	// contains filtered or unexported fields
}

func (*Watcher) Next added in v1.6.6

func (w *Watcher) Next() (*servicediscovery.Result, error)

func (*Watcher) Stop added in v1.6.6

func (w *Watcher) Stop()

Jump to

Keyboard shortcuts

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