discovery

package
v0.0.0-...-72c2bb7 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discovery

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

Discovery implementation to allow a service to self register with consul

func New

func New(consulAddr, serviceKey, address string, port int, ttl time.Duration) *Discovery

New Discovery register

func (*Discovery) SelfRegister

func (d *Discovery) SelfRegister(ctx context.Context) error

SelfRegister with consul

func (*Discovery) SetHealthFN

func (d *Discovery) SetHealthFN(fn HealthFN)

SetHealthFN for allowing custom health checks to be called every ttl / 2.

type HealthFN

type HealthFN func() error

HealthFN is a health check function that runs every ttl / 2 to let consul know the service is up/healthy

Jump to

Keyboard shortcuts

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