daemon

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sleep

func Sleep(ctx context.Context, d time.Duration) bool

Sleep with context, returns false if context was canceled

func WatchServiceChanges

func WatchServiceChanges(client *api.Client, ctx context.Context, newService chan<- string, delService chan<- string, config Config)

func WatchServices

func WatchServices(client *api.Client, ctx context.Context, servicesChan chan<- serviceMap, errorTimeout time.Duration)

Types

type ChecksWatcher

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

func NewChecksWatcher

func NewChecksWatcher(service string, client *api.Client, ctx context.Context, config Config) *ChecksWatcher

func (*ChecksWatcher) Run

func (w *ChecksWatcher) Run(logger HealthCheckLogger)

func (*ChecksWatcher) Stop

func (w *ChecksWatcher) Stop()

type Config

type Config struct {
	ConsulConfig *api.Config
	ErrorTimeout time.Duration
}

func DefaultConfig

func DefaultConfig() Config

type Daemon

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

func NewDaemon

func NewDaemon(config Config) (*Daemon, error)

func (*Daemon) Run

func (d *Daemon) Run()

func (*Daemon) Stop

func (d *Daemon) Stop()

type HealthCheckLogger

type HealthCheckLogger interface {
	// contains filtered or unexported methods
}

type JsonHealthCheckLogger

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

func NewJsonHealthCheckLogger

func NewJsonHealthCheckLogger() *JsonHealthCheckLogger

Jump to

Keyboard shortcuts

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