service

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service interface {
	Name() string
	Start() error
	Stop(context.Context) error
	Restart(context.Context) error
	Status() Status
}

Service is a restartable background component owned by the application.

type State

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

State centralizes the synchronized runtime metadata shared by services.

func NewState

func NewState(name string) *State

func (*State) Restarted

func (s *State) Restarted()

func (*State) Snapshot

func (s *State) Snapshot() Status

func (*State) Started

func (s *State) Started()

func (*State) Stopped

func (s *State) Stopped(err error)

type Status

type Status struct {
	Name      string    `json:"name"`
	Running   bool      `json:"running"`
	Restarts  uint64    `json:"restarts"`
	StartedAt time.Time `json:"startedAt,omitzero"`
	StoppedAt time.Time `json:"stoppedAt,omitzero"`
	UpdatedAt time.Time `json:"updatedAt"`
	LastError string    `json:"lastError,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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