system

package
v1.0.427-c3cadfa Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthChecker

type HealthChecker interface {
	HealthChecks() (name string, ready, live func(ctx context.Context) error)
}

type MetricProducer

type MetricProducer interface {
	// MetricName The name for this group of metrics
	//(Name might be cleaner, but is much more likely to conflict in implementations)
	MetricName() string
	// Gauges are instantaneous name value pairs
	Gauges(context.Context) map[string]float64
}

type System

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

func New

func New(ctx context.Context) *System

func (*System) AddCleanup

func (r *System) AddCleanup(c func(ctx context.Context) error)

func (*System) AddHealthCheck

func (r *System) AddHealthCheck(h HealthChecker)

func (*System) AddMetrics

func (r *System) AddMetrics(m MetricProducer)

func (*System) AddService

func (r *System) AddService(s func(ctx context.Context) error)

func (*System) Cleanup

func (r *System) Cleanup(ctx context.Context)

func (*System) HealthChecks

func (r *System) HealthChecks() []HealthChecker

func (*System) Run

func (r *System) Run(delay time.Duration) (err error)

Jump to

Keyboard shortcuts

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