service

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: MIT Imports: 23 Imported by: 2

Documentation

Index

Constants

View Source
const (
	MaxEventSize = 20
)

Variables

This section is empty.

Functions

func NewService

func NewService(name string, ln listener.Listener, h handler.Handler, opts ...Option) service.Service

Types

type Event

type Event struct {
	Time    time.Time
	Message string
}

type Option

type Option func(opts *options)

func AdmissionOption

func AdmissionOption(admission admission.Admission) Option

func LoggerOption

func LoggerOption(logger logger.Logger) Option

func ObserverOption

func ObserverOption(observer observer.Observer) Option

func ObserverPeriodOption added in v0.3.0

func ObserverPeriodOption(period time.Duration) Option

func PostDownOption

func PostDownOption(cmds []string) Option

func PostUpOption

func PostUpOption(cmds []string) Option

func PreDownOption

func PreDownOption(cmds []string) Option

func PreUpOption

func PreUpOption(cmds []string) Option

func RecordersOption

func RecordersOption(recorders ...recorder.RecorderObject) Option

func StatsOption

func StatsOption(stats stats.Stats) Option

type ServiceEvent

type ServiceEvent struct {
	Kind    string
	Service string
	State   State
	Msg     string
}

func (ServiceEvent) Type

type State

type State string
const (
	StateRunning State = "running"
	StateReady   State = "ready"
	StateFailed  State = "failed"
	StateClosed  State = "closed"
)

type Status

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

func (*Status) CreateTime

func (p *Status) CreateTime() time.Time

func (*Status) Events

func (p *Status) Events() []Event

func (*Status) State

func (p *Status) State() State

func (*Status) Stats

func (p *Status) Stats() stats.Stats

Jump to

Keyboard shortcuts

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