pm

package module
v0.0.0-...-b7165b1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Notify

func Notify(ctx context.Context, s Status)

Types

type Cmd

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

func NewCmd

func NewCmd(name, bin string, args ...string) *Cmd

func (*Cmd) Serve

func (c *Cmd) Serve(ctx context.Context) error

func (*Cmd) Signal

func (c *Cmd) Signal(sig os.Signal) error

func (*Cmd) String

func (c *Cmd) String() string

func (*Cmd) WithOpts

func (c *Cmd) WithOpts(opts ...CmdOpt) *Cmd

type CmdOpt

type CmdOpt func(o *cmdOpts)

func WithEnv

func WithEnv(env []string) CmdOpt

func WithStderr

func WithStderr(w io.Writer) CmdOpt

func WithStdin

func WithStdin(r io.Reader) CmdOpt

func WithStdout

func WithStdout(w io.Writer) CmdOpt

type Manager

type Manager interface {
	Add(s Service) error
	Stop(s Service) error
	Run(ctx context.Context) error
	Status(...string) map[string]Status
	Watch(ctx context.Context, fn func(map[string]Status))
}

func New

func New(ctx context.Context, name string) Manager

type Service

type Service interface {
	suture.Service
	fmt.Stringer
}

func NewServiceFunc

func NewServiceFunc(name string, f ServiceFunc) Service

type ServiceFunc

type ServiceFunc func(ctx context.Context) error

type Status

type Status uint32
const (
	StatusUnknown Status = iota
	StatusStarting
	StatusRunning
	StatusStopping
	StatusStopped
	StatusError
	StatusCrashLoop
)

func (Status) String

func (s Status) String() string

type Wrapper

type Wrapper interface {
	Unwrap() Service
}

Directories

Path Synopsis
example module

Jump to

Keyboard shortcuts

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