nacosserviceregistry

package
v2.7.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package nacosserviceregistry provides the NacosServiceRegistry.

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 `json:"scheme,omitempty" jsonschema:"enum=http,enum=https"`
	ContextPath string `json:"contextPath,omitempty"`
	IPAddr      string `json:"ipAddr" jsonschema:"required"`
	Port        uint16 `json:"port" jsonschema:"required"`
}

ServerSpec is the server config of Nacos.

type Spec

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

Spec describes the NacosServiceRegistry.

func (Spec) Validate

func (spec Spec) Validate() error

Validate validates Spec itself.

type Status

type Status struct {
	Health              string         `json:"health"`
	ServiceInstancesNum map[string]int `json:"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