consul

package
v0.0.0-...-7cb662a Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const RegistryName = "consul"

Variables

View Source
var ConsulNotFoundErr = errors.New("The client could not be found")
View Source
var ConsulRegistionErr = errors.New("Registion failed")
View Source
var NacosDeregistionErr = errors.New("Deregistion failed")
View Source
var NacosGetServiceErr = errors.New("Nacos get services failed")
View Source
var NacosParamErr = errors.New("Registion failed")
View Source
var NacosSubscribeErr = errors.New("Nacos subscription failed")
View Source
var NacosUnsubscribeErr = errors.New("Nacos Unsubscription failed")
View Source
var NacosWeightErr = errors.New("Weight must be lager than 0")

Functions

func NewAgentServiceRegistration

func NewAgentServiceRegistration(service *vo2.Service) *api.AgentServiceRegistration

create agentService

Types

type ConsulRegistry

type ConsulRegistry struct {
	sync.Mutex
	Client   *api.Client
	Services map[string][]*vo2.Service
}

func ConsulInit

func ConsulInit(c *api.Config) (*ConsulRegistry, error)

init consul client

func (*ConsulRegistry) Get

func (c *ConsulRegistry) Get(ctx context.Context, service *vo2.Service) ([]*vo2.Service, error)

get services

func (*ConsulRegistry) Init

func (c *ConsulRegistry) Init(ctx context.Context, f func() error) error

func (*ConsulRegistry) PluginName

func (c *ConsulRegistry) PluginName() string

func (*ConsulRegistry) Register

func (c *ConsulRegistry) Register(ctx context.Context, service *vo2.Service) error

register base

func (*ConsulRegistry) SubscribeService

func (c *ConsulRegistry) SubscribeService(ctx context.Context, service *vo2.Service) error

subscribe Service

func (*ConsulRegistry) UnRegister

func (c *ConsulRegistry) UnRegister(ctx context.Context, service *vo2.Service) error

unregister base

Jump to

Keyboard shortcuts

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