consulserviceregistry

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

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

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

	// MetaKeyRegistryName is the key of service metadata.
	// NOTE: Namespace is only available for Consul Enterprise,
	// instead we use this field to work around.
	MetaKeyRegistryName = "RegistryName"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsulServiceRegistry

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

ConsulServiceRegistry is Object ConsulServiceRegistry.

func (*ConsulServiceRegistry) ApplyServiceInstances

func (c *ConsulServiceRegistry) ApplyServiceInstances(instances map[string]*serviceregistry.ServiceInstanceSpec) error

ApplyServiceInstances applies service instances to the registry.

func (*ConsulServiceRegistry) Category

Category returns the category of ConsulServiceRegistry.

func (*ConsulServiceRegistry) Close

func (c *ConsulServiceRegistry) Close()

Close closes ConsulServiceRegistry.

func (*ConsulServiceRegistry) DefaultSpec

func (c *ConsulServiceRegistry) DefaultSpec() interface{}

DefaultSpec returns the default spec of ConsulServiceRegistry.

func (*ConsulServiceRegistry) DeleteServiceInstances

func (c *ConsulServiceRegistry) DeleteServiceInstances(instances map[string]*serviceregistry.ServiceInstanceSpec) error

DeleteServiceInstances applies service instances to the registry.

func (*ConsulServiceRegistry) GetServiceInstance

func (c *ConsulServiceRegistry) GetServiceInstance(serviceName, instanceID string) (*serviceregistry.ServiceInstanceSpec, error)

GetServiceInstance get service instance from the registry.

func (*ConsulServiceRegistry) Inherit

func (c *ConsulServiceRegistry) Inherit(superSpec *supervisor.Spec, previousGeneration supervisor.Object)

Inherit inherits previous generation of ConsulServiceRegistry.

func (*ConsulServiceRegistry) Init

func (c *ConsulServiceRegistry) Init(superSpec *supervisor.Spec)

Init initializes ConsulServiceRegistry.

func (*ConsulServiceRegistry) Kind

func (c *ConsulServiceRegistry) Kind() string

Kind returns the kind of ConsulServiceRegistry.

func (*ConsulServiceRegistry) ListAllServiceInstances

func (c *ConsulServiceRegistry) ListAllServiceInstances() (map[string]*serviceregistry.ServiceInstanceSpec, error)

ListAllServiceInstances list all service instances from the registry.

func (*ConsulServiceRegistry) ListServiceInstances

func (c *ConsulServiceRegistry) ListServiceInstances(serviceName string) (map[string]*serviceregistry.ServiceInstanceSpec, error)

ListServiceInstances list service instances of one service from the registry.

func (*ConsulServiceRegistry) Name

func (c *ConsulServiceRegistry) Name() string

Name returns name.

func (*ConsulServiceRegistry) Notify

Notify returns notify channel.

func (*ConsulServiceRegistry) Status

Status returns status of ConsulServiceRegister.

type Spec

type Spec struct {
	Address      string   `yaml:"address" jsonschema:"required"`
	Scheme       string   `yaml:"scheme" jsonschema:"required,enum=http,enum=https"`
	Datacenter   string   `yaml:"datacenter" jsonschema:"omitempty"`
	Token        string   `yaml:"token" jsonschema:"omitempty"`
	Namespace    string   `yaml:"namespace" jsonschema:"omitempty"`
	SyncInterval string   `yaml:"syncInterval" jsonschema:"required,format=duration"`
	ServiceTags  []string `yaml:"serviceTags" jsonschema:"omitempty"`
}

Spec describes the ConsulServiceRegistry.

type Status

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

Status is the status of ConsulServiceRegistry.

Jump to

Keyboard shortcuts

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