discover

package
v0.0.0-...-69ec864 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance struct {
	InstanceId string            `json:"instanceId"`
	Ip         string            `json:"ip"`
	Port       uint64            `json:"port"`
	Healthy    bool              `json:"healthy"`
	Enable     bool              `json:"enabled"`
	Metadata   map[string]string `json:"metadata"`
}

func (Instance) ID

func (i Instance) ID() string

type Interface

type Interface interface {
	GetAvailableInstances() ([]Instance, error)
	UpdateInstance(Instance) error
	Subscribe(callback func(services []Instance, err error)) error
	Register(i Instance) (bool, error)
	UnRegister(i Instance) (bool, error)
}

func NewNacosDiscover

func NewNacosDiscover(cfg NacosConfig) (Interface, error)

type NacosConfig

type NacosConfig struct {
	IpAddr      string
	Port        uint64
	NamespaceId string
	ServiceName string
	GroupName   string
	ClusterName string
	LogLevel    string
}

Jump to

Keyboard shortcuts

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