service

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxEventSize = 20
)

Variables

This section is empty.

Functions

func NewService

func NewService(name string, ln listener.IListener, h handler.IHandler, opts ...Option) service.IService

Types

type Event added in v0.0.5

type Event struct {
	Time    time.Time
	Message string
}

type Option

type Option func(opts *options)

func AdmissionOption

func AdmissionOption(admission admission.IAdmission) Option

func LoggerOption

func LoggerOption(logger logger.ILogger) Option

func ObservePeriodOption added in v0.0.10

func ObservePeriodOption(period time.Duration) Option

func ObserverOption added in v0.0.5

func ObserverOption(observer observer.IObserver) 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 added in v0.0.5

func StatsOption(stats *stats.Stats) Option

type ServiceEvent added in v0.0.5

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

func (ServiceEvent) Type added in v0.0.5

type State added in v0.0.5

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

type Status added in v0.0.5

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

func (*Status) CreateTime added in v0.0.5

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

func (*Status) Events added in v0.0.5

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

func (*Status) State added in v0.0.5

func (p *Status) State() State

func (*Status) Stats added in v0.0.5

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

Jump to

Keyboard shortcuts

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