package
0.24.0
Repository: https://github.com/lushdigital/core.git
Documentation: pkg.go.dev

# README

Workers

The core/workers package is used to setup gracefully terminating workers for services.

Examples

The worker interfaces

All workers implement a simple interface for running and halting, using the context package for timeouts.

// Runner represents the behaviour for running a service worker.
type Runner interface {
	// Run should run start processing the worker and be a blocking operation.
	Run(context.Context) error
}

// Halter represents the behaviour for stopping a service worker.
type Halter interface {
	// Halt should tell the worker to stop doing work.
	Halt(context.Context) error
}

// Worker represents the behaviour for a service worker.
type Worker interface {
	Runner
	Halter
}

# Packages

Package grpcsrv provides a default set of configuration for hosting a grpc server in a service.
Package httpsrv provides a default set of configuration for hosting a http server in a service.
Package keybroker implements a background broker conmtinous retrieval of public keys from multiple different type of sources.
Package metricsrv provides a default set of configuration for hosting http prometheus metrics in a service.
Package readysrv is used to provide readiness checks for a service.