consul

package
v0.0.0-...-93c743e Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyProtocol  = "protocol"
	KeyHealthURL = "health_url"
)
View Source
const (
	HealthPassing     = "passing"
	HealthWarning     = "warning"
	HealthCritical    = "critical"
	HealthMaintenance = "maintenance"
)

Variables

This section is empty.

Functions

func NewNaming

func NewNaming(consulUrl string) (naming.Naming, error)

Types

type Naming

type Naming struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Naming) Deregister

func (n *Naming) Deregister(serviceID string) error

func (*Naming) Find

func (n *Naming) Find(serviceName string, tags ...string) ([]him.ServiceRegistration, error)

func (*Naming) Register

func (n *Naming) Register(s him.ServiceRegistration) error

func (*Naming) Subscribe

func (n *Naming) Subscribe(serviceName string, callback func(services []him.ServiceRegistration)) error

func (*Naming) Unsubscribe

func (n *Naming) Unsubscribe(serviceName string) error

type Watch

type Watch struct {
	Service   string
	Callback  func([]him.ServiceRegistration)
	WaitIndex uint64
	Quit      chan struct{}
}

Jump to

Keyboard shortcuts

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