state

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: BSD-3-Clause Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Unknown when we failed to find out.
	Unknown installState = iota
	// NotInstalled means launchd has never heard of the service.
	NotInstalled
	// PlistPresentButNotLoaded means the file exists but hasn't been registered.
	PlistPresentButNotLoaded
	// Installed means everything is good, the service is properly registered.
	Installed
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Install

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

Install describes the current installation state of a launchd service.

func NewInstall

func NewInstall(svc Installable) *Install

NewInstall computes and returns the installation state for a service.

func (*Install) Color

func (s *Install) Color() string

Color is the state name rendered with ANSI color escape sequences.

func (*Install) Err

func (s *Install) Err() string

Err is a description of the error encountered while computing the state, if any.

func (*Install) Is

func (s *Install) Is(enum installState) bool

Is compares using the underlying enum value

func (*Install) Pretty

func (s *Install) Pretty() string

Pretty is a description of the state formatted nicely for display.

func (*Install) String

func (s *Install) String() string

String is the state name.

type Installable

type Installable interface {
	DefinitionPath() (string, error)
	Print() ([]byte, error)
}

Installable is the interface we depend on to determine install state.

type Run

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

Run describes the current runtime state of a launchd service.

func NewRun

func NewRun(s Runnable) *Run

NewRun computes and returns the current runtime status of a service.

func (*Run) Color

func (s *Run) Color() string

Color is the state name rendered with ANSI color escape sequences.

func (*Run) Err

func (s *Run) Err() string

Err is a description of the error encountered while computing the state, if any.

func (*Run) Is

func (s *Run) Is(enum RunState) bool

Is compares using the underlying enum value

func (*Run) Pretty

func (s *Run) Pretty() string

Pretty is a description of the state formatted nicely for display.

func (*Run) String

func (s *Run) String() string

String is the state name.

type RunState

type RunState int

RunState enumerates the runtime states that a launchd service may be in.

const (
	NoSuchService RunState
	Running
	Starting
	NotRunning
)

func (RunState) String

func (i RunState) String() string

type Runnable

type Runnable interface {
	Print() ([]byte, error)
}

Runnable is the interface we depend on to determine a service's run state.

Jump to

Keyboard shortcuts

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