consulserviceregistry

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: 9 Imported by: 0

Documentation

Overview

Package consulserviceregistry provides ConsulServiceRegistry.

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   `json:"address" jsonschema:"required"`
	Scheme       string   `json:"scheme" jsonschema:"required,enum=http,enum=https"`
	Datacenter   string   `json:"datacenter,omitempty"`
	Token        string   `json:"token,omitempty"`
	Namespace    string   `json:"namespace,omitempty"`
	SyncInterval string   `json:"syncInterval" jsonschema:"required,format=duration"`
	ServiceTags  []string `json:"serviceTags,omitempty"`
}

Spec describes the ConsulServiceRegistry.

type Status

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