consul

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 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 regisry.

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

Register creates a service record in the registry.

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) 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