consul

package
v0.0.0-...-350df58 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: Apache-2.0 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(addr string) (*Registry, error)

NewRegistry creates a new Consul-based service registry instance.

func (*Registry) Deregister

func (r *Registry) Deregister(ctx context.Context, instanceID string, _ 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

func (*Registry) ReportHealthyState

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

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

func (*Registry) ServiceAddress

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

ServiceAddress return the list of address 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