Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLogger ¶
NewLogger creates a logger for the supervisor or other actions
The logger expects the following env variables:
HONEYCOMB_API_KEY (no default, blank to skip honeycomb integration) NODE_NAME (no default, name of k8s node for logging) POD_NAME (no default, name of k8s pod for logging)
func ParseFloat ¶
func ParseFloat(raw json.RawMessage) (float32, error)
ParseFloat defensively parses a raw json field into a float
func ParseString ¶
func ParseString(raw json.RawMessage) (string, error)
ParseString defensively parses a raw json field into a string
Types ¶
type Supervisor ¶
Supervisor is a supervised instance of a running daemon
func (*Supervisor) CloseAfter ¶
func (d *Supervisor) CloseAfter(duration time.Duration)
CloseAfter closes the daemon after the specified delay
func (*Supervisor) CloseWait ¶
func (d *Supervisor) CloseWait()
CloseWait invokes a deamon shutdown and blocks until complete
func (*Supervisor) Run ¶
func (d *Supervisor) Run(ctx context.Context, fn func(ctx context.Context, d *Supervisor) error)
Run executes a background function
The daemon will shutdown if the function returns an unhandled error.
Click to show internal directories.
Click to hide internal directories.