consul

package
v0.0.0-...-2e14e4b Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

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

Registry defines a Consul-based service registry.

func NewRegistry

func NewRegistry(address string) (*Registry, error)

NewRegistry creates a new Consul-based service.

func (*Registry) Deregister

func (r *Registry) Deregister(ctx context.Context, instanceID string, serviceName string) error

Deregister removes a service record from the registry.

func (*Registry) Register

func (r *Registry) Register(ctx context.Context, instanceID string, serviceName string, hostPort string) error

Register creates a service record in the registry.

func (*Registry) ReportHealthyState

func (r *Registry) ReportHealthyState(instanceID string, serviceName string) error

ReportHealthyState is a push mechanism for reporting healthy state to the registry.

func (*Registry) ServiceAddresses

func (r *Registry) ServiceAddresses(ctx context.Context, serviceName string) ([]string, error)

ServiceAddresses returns the list of addresses of active instances of the given service.

Jump to

Keyboard shortcuts

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