agent

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent interface {
	ServicesWithFilter(filter string) (map[string]*api.AgentService, error)
	ServiceRegister(service *api.AgentServiceRegistration) error
	ServiceDeregister(serviceID string) error
}

Agent interface provide common function for work with Consul HTTP API

type Registry

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

Registry is implementation of core.Registry interface

func NewRegistry

func NewRegistry(agent Agent, tag consul.Tag) *Registry

NewRegistry provide Registry as core.Registry implementation

func (*Registry) Deregister

func (r *Registry) Deregister(ctx context.Context, service *core.Service) error

Deregister make request for Agent.ServiceDeregister by core.Service RegistrationID

func (*Registry) Fetch

func (r *Registry) Fetch(_ context.Context) (core.Services, error)

Fetch make request for Agent.Services and try to cast result to core.Services

func (*Registry) Register

func (r *Registry) Register(ctx context.Context, service *core.Service) error

Register make request for Agent.ServiceRegister for core.Service

func (*Registry) WithLogger

func (r *Registry) WithLogger(logger core.LoggerInterface)

WithLogger is implementation of core.Loggable interface

Jump to

Keyboard shortcuts

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