nacos

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrServiceInstanceNameEmpty = errors.New("kratos/nacos: ServiceInstance.Name can not be empty")

Functions

This section is empty.

Types

type Option

type Option func(o *options)

Option is nacos option.

func WithCluster

func WithCluster(cluster string) Option

WithCluster with a cluster option.

func WithDefaultKind

func WithDefaultKind(kind string) Option

WithDefaultKind with a default kind option.

func WithGroup

func WithGroup(group string) Option

WithGroup with a group option.

func WithPrefix

func WithPrefix(prefix string) Option

WithPrefix with a prefix path.

func WithWeight

func WithWeight(weight float64) Option

WithWeight with a weight option.

type Registry

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

Registry is nacos registry.

func New

func New(cli naming_client.INamingClient, opts ...Option) (r *Registry)

New a nacos registry.

func NewRegistry

func NewRegistry(c *conf.Registry) *Registry

NewRegistry 创建一个注册发现客户端 - Nacos

func (*Registry) Deregister

func (r *Registry) Deregister(_ context.Context, service *registry.ServiceInstance) error

Deregister the registration.

func (*Registry) GetService

func (r *Registry) GetService(_ context.Context, serviceName string) ([]*registry.ServiceInstance, error)

GetService return the service instances in memory according to the service name.

func (*Registry) Register

func (r *Registry) Register(_ context.Context, si *registry.ServiceInstance) error

Register the registration.

func (*Registry) Watch

func (r *Registry) Watch(ctx context.Context, serviceName string) (registry.Watcher, error)

Watch creates a watcher according to the service name.

Jump to

Keyboard shortcuts

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