nacosserviceregistry

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Category is the category of NacosServiceRegistry.
	Category = supervisor.CategoryBusinessController

	// Kind is the kind of NacosServiceRegistry.
	Kind = "NacosServiceRegistry"

	// MetaKeyRegistryName is the key of service registry name.
	MetaKeyRegistryName = "RegistryName"

	// MetaKeyInstanceID is the key of service instance ID.
	MetaKeyInstanceID = "InstanceID"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NacosServiceRegistry

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

NacosServiceRegistry is Object NacosServiceRegistry.

func (*NacosServiceRegistry) ApplyServiceInstances

func (n *NacosServiceRegistry) ApplyServiceInstances(instances map[string]*serviceregistry.ServiceInstanceSpec) error

ApplyServiceInstances applies service instances to the registry.

func (*NacosServiceRegistry) Category

Category returns the category of NacosServiceRegistry.

func (*NacosServiceRegistry) Close

func (n *NacosServiceRegistry) Close()

Close closes NacosServiceRegistry.

func (*NacosServiceRegistry) DefaultSpec

func (n *NacosServiceRegistry) DefaultSpec() interface{}

DefaultSpec returns the default spec of NacosServiceRegistry.

func (*NacosServiceRegistry) DeleteServiceInstances

func (n *NacosServiceRegistry) DeleteServiceInstances(instances map[string]*serviceregistry.ServiceInstanceSpec) error

DeleteServiceInstances applies service instances to the registry.

func (*NacosServiceRegistry) GetServiceInstance

func (n *NacosServiceRegistry) GetServiceInstance(serviceName, instanceID string) (*serviceregistry.ServiceInstanceSpec, error)

GetServiceInstance get service instance from the registry.

func (*NacosServiceRegistry) Inherit

func (n *NacosServiceRegistry) Inherit(superSpec *supervisor.Spec, previousGeneration supervisor.Object)

Inherit inherits previous generation of NacosServiceRegistry.

func (*NacosServiceRegistry) Init

func (n *NacosServiceRegistry) Init(superSpec *supervisor.Spec)

Init initializes NacosServiceRegistry.

func (*NacosServiceRegistry) Kind

func (n *NacosServiceRegistry) Kind() string

Kind returns the kind of NacosServiceRegistry.

func (*NacosServiceRegistry) ListAllServiceInstances

func (n *NacosServiceRegistry) ListAllServiceInstances() (map[string]*serviceregistry.ServiceInstanceSpec, error)

ListAllServiceInstances list all service instances from the registry.

func (*NacosServiceRegistry) ListServiceInstances

func (n *NacosServiceRegistry) ListServiceInstances(serviceName string) (map[string]*serviceregistry.ServiceInstanceSpec, error)

ListServiceInstances list service instances of one service from the registry.

func (*NacosServiceRegistry) Name

func (n *NacosServiceRegistry) Name() string

Name returns name.

func (*NacosServiceRegistry) Notify

Notify returns notify channel.

func (*NacosServiceRegistry) Status

func (n *NacosServiceRegistry) Status() *supervisor.Status

Status returns status of NacosServiceRegister.

type ServerSpec

type ServerSpec struct {
	Scheme      string `yaml:"scheme" jsonschema:"omitempty,enum=http,enum=https"`
	ContextPath string `yaml:"contextPath" jsonschema:"omitempty"`
	IPAddr      string `yaml:"ipAddr" jsonschema:"required"`
	Port        uint16 `yaml:"port" jsonschema:"required"`
}

ServerSpec is the server config of Nacos.

type Spec

type Spec struct {
	Servers      []*ServerSpec `yaml:"servers" jsonschema:"required"`
	SyncInterval string        `yaml:"syncInterval" jsonschema:"required,format=duration"`
	Namespace    string        `yaml:"namespace" jsonschema:"omitempty"`
	Username     string        `yaml:"username" jsonschema:"omitempty"`
	Password     string        `yaml:"password" jsonschema:"omitempty"`
}

Spec describes the NacosServiceRegistry.

func (Spec) Validate

func (spec Spec) Validate() error

Validate validates Spec itself.

type Status

type Status struct {
	Health              string         `yaml:"health"`
	ServiceInstancesNum map[string]int `yaml:"instancesNum"`
}

Status is the status of NacosServiceRegistry.

Jump to

Keyboard shortcuts

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