proc

package
v1.9.9 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ShutdownWaitingTimeSeconds = 10
)

Variables

View Source
var (
	ProcessWillBeRestartedError = errors.New("process will be restarted")
	ProcessWillBeStoppedError   = errors.New("process will be stopped")
)

Functions

func ReapChildren added in v1.7.0

func ReapChildren()

Types

type Api added in v1.8.0

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

func NewApi added in v1.8.0

func NewApi(listenAddress string) *Api

func (*Api) RegisterHandler added in v1.8.0

func (api *Api) RegisterHandler(router *mux.Router, path string, methods []string, handler func(http.ResponseWriter, *http.Request))

func (*Api) RegisterMiddlewareFuncs added in v1.8.0

func (api *Api) RegisterMiddlewareFuncs(middlewareFunc ...mux.MiddlewareFunc)

func (*Api) Shutdown added in v1.8.0

func (api *Api) Shutdown() error

func (*Api) Start added in v1.8.0

func (api *Api) Start() error

type BootJob added in v1.6.0

type BootJob struct {
	Config *config.BootJobConfig
	// contains filtered or unexported fields
}

func NewBootJob added in v1.6.0

func NewBootJob(c *config.BootJobConfig) (*BootJob, error)

func (*BootJob) CreateAndOpenStdFile added in v1.9.7

func (job *BootJob) CreateAndOpenStdFile(jobConfig *config.BaseJobConfig) error

func (*BootJob) GetName added in v1.8.0

func (job *BootJob) GetName() string

func (*BootJob) GetPhase added in v1.9.2

func (job *BootJob) GetPhase() *JobPhase

func (*BootJob) IsControllable added in v1.8.0

func (job *BootJob) IsControllable() bool

func (*BootJob) MarkForRestart added in v1.7.8

func (job *BootJob) MarkForRestart()

func (*BootJob) Reset added in v1.9.2

func (job *BootJob) Reset()

func (*BootJob) Run added in v1.6.0

func (job *BootJob) Run(ctx context.Context) error

func (*BootJob) Signal added in v1.7.0

func (job *BootJob) Signal(sig os.Signal)

func (*BootJob) SignalAll added in v1.9.1

func (job *BootJob) SignalAll(sig syscall.Signal)

func (*BootJob) StreamStdErr added in v1.8.1

func (job *BootJob) StreamStdErr(ctx context.Context, outChan chan []byte, errChan chan error, follow bool, tailLen int)

func (*BootJob) StreamStdOut added in v1.8.1

func (job *BootJob) StreamStdOut(ctx context.Context, outChan chan []byte, errChan chan error, follow bool, tailLen int)

func (*BootJob) StreamStdOutAndStdErr added in v1.8.1

func (job *BootJob) StreamStdOutAndStdErr(ctx context.Context, outChan chan []byte, stdOutErrChan, stdErrErrChan chan error, follow bool, tailLen int)

type CommonJob added in v1.7.0

type CommonJob struct {
	Config *config.JobConfig
	// contains filtered or unexported fields
}

func NewCommonJob added in v1.7.0

func NewCommonJob(c *config.JobConfig) (*CommonJob, error)

func (*CommonJob) CreateAndOpenStdFile added in v1.9.7

func (job *CommonJob) CreateAndOpenStdFile(jobConfig *config.BaseJobConfig) error

func (*CommonJob) GetName added in v1.8.0

func (job *CommonJob) GetName() string

func (*CommonJob) GetPhase added in v1.9.2

func (job *CommonJob) GetPhase() *JobPhase

func (*CommonJob) Init added in v1.7.0

func (job *CommonJob) Init()

func (*CommonJob) IsControllable added in v1.8.0

func (job *CommonJob) IsControllable() bool

func (*CommonJob) IsRunning added in v1.8.0

func (job *CommonJob) IsRunning() bool

func (*CommonJob) MarkForRestart added in v1.7.8

func (job *CommonJob) MarkForRestart()

func (*CommonJob) Reset added in v1.9.2

func (job *CommonJob) Reset()

func (*CommonJob) Restart added in v1.8.0

func (job *CommonJob) Restart()

func (*CommonJob) Run added in v1.7.0

func (job *CommonJob) Run(ctx context.Context, _ chan<- error) error

func (*CommonJob) Signal added in v1.7.0

func (job *CommonJob) Signal(sig os.Signal)

func (*CommonJob) SignalAll added in v1.9.1

func (job *CommonJob) SignalAll(sig syscall.Signal)

func (*CommonJob) Status added in v1.8.0

func (job *CommonJob) Status() *CommonJobStatus

func (*CommonJob) Stop added in v1.8.0

func (job *CommonJob) Stop()

func (*CommonJob) StreamStdErr added in v1.8.1

func (job *CommonJob) StreamStdErr(ctx context.Context, outChan chan []byte, errChan chan error, follow bool, tailLen int)

func (*CommonJob) StreamStdOut added in v1.8.1

func (job *CommonJob) StreamStdOut(ctx context.Context, outChan chan []byte, errChan chan error, follow bool, tailLen int)

func (*CommonJob) StreamStdOutAndStdErr added in v1.8.1

func (job *CommonJob) StreamStdOutAndStdErr(ctx context.Context, outChan chan []byte, stdOutErrChan, stdErrErrChan chan error, follow bool, tailLen int)

func (*CommonJob) Watch added in v1.7.0

func (job *CommonJob) Watch()

type CommonJobStatus added in v1.8.0

type CommonJobStatus struct {
	Pid     int               `json:"pid,omitempty"`
	Running bool              `json:"running"`
	Phase   JobPhase          `json:"phase"`
	Config  *config.JobConfig `json:"config"`
}

type Job added in v1.3.0

type Job interface {
	Init()
	Run(context.Context, chan<- error) error
	Watch()
	Reset()

	GetPhase() *JobPhase
	GetName() string
}

type JobPhase added in v1.9.0

type JobPhase struct {
	Reason     JobPhaseReason `json:"reason"`
	LastChange time.Time      `json:"lastChange"`
}

func (*JobPhase) Is added in v1.9.2

func (p *JobPhase) Is(reason JobPhaseReason) bool

func (*JobPhase) Set added in v1.9.0

func (p *JobPhase) Set(reason JobPhaseReason)

type JobPhaseReason added in v1.9.0

type JobPhaseReason string
const (
	JobPhaseReasonUnknown            JobPhaseReason = "unknown"
	JobPhaseReasonAwaitingReadiness  JobPhaseReason = "awaitingReadiness"
	JobPhaseReasonAwaitingConnection JobPhaseReason = "awaitingConnection"
	JobPhaseReasonStarted            JobPhaseReason = "started"
	JobPhaseReasonStopped            JobPhaseReason = "stopped"
	JobPhaseReasonCompleted          JobPhaseReason = "completed"
	JobPhaseReasonFailed             JobPhaseReason = "failed"
	JobPhaseReasonCrashLooping       JobPhaseReason = "crashLooping"
)

type LazyJob added in v1.7.0

type LazyJob struct {
	CommonJob
	// contains filtered or unexported fields
}

func NewLazyJob added in v1.7.0

func NewLazyJob(c *config.JobConfig) (*LazyJob, error)

func (*LazyJob) AssertStarted added in v1.7.0

func (job *LazyJob) AssertStarted(ctx context.Context) error

func (*LazyJob) CreateAndOpenStdFile added in v1.9.7

func (job *LazyJob) CreateAndOpenStdFile(jobConfig *config.BaseJobConfig) error

func (*LazyJob) GetName added in v1.8.0

func (job *LazyJob) GetName() string

func (*LazyJob) GetPhase added in v1.9.2

func (job *LazyJob) GetPhase() *JobPhase

func (*LazyJob) IsControllable added in v1.8.0

func (job *LazyJob) IsControllable() bool

func (*LazyJob) MarkForRestart added in v1.7.8

func (job *LazyJob) MarkForRestart()

func (*LazyJob) Reset added in v1.9.2

func (job *LazyJob) Reset()

func (*LazyJob) Run added in v1.7.0

func (job *LazyJob) Run(ctx context.Context, errors chan<- error) error

func (*LazyJob) Signal added in v1.7.0

func (job *LazyJob) Signal(sig os.Signal)

func (*LazyJob) SignalAll added in v1.9.1

func (job *LazyJob) SignalAll(sig syscall.Signal)

func (*LazyJob) StreamStdErr added in v1.8.1

func (job *LazyJob) StreamStdErr(ctx context.Context, outChan chan []byte, errChan chan error, follow bool, tailLen int)

func (*LazyJob) StreamStdOut added in v1.8.1

func (job *LazyJob) StreamStdOut(ctx context.Context, outChan chan []byte, errChan chan error, follow bool, tailLen int)

func (*LazyJob) StreamStdOutAndStdErr added in v1.8.1

func (job *LazyJob) StreamStdOutAndStdErr(ctx context.Context, outChan chan []byte, stdOutErrChan, stdErrErrChan chan error, follow bool, tailLen int)

type Listener added in v1.4.0

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

func NewListener added in v1.4.0

func NewListener(j *LazyJob, c *config.Listener) (*Listener, error)

func (*Listener) Run added in v1.4.0

func (l *Listener) Run(ctx context.Context) error

type Runner added in v1.3.0

type Runner struct {
	IgnitionConfig *config.Ignition
	// contains filtered or unexported fields
}

func NewRunner added in v1.3.0

func NewRunner(ctx context.Context, api *Api, keepRunning bool, ignitionConfig *config.Ignition) *Runner

func (*Runner) Boot added in v1.6.0

func (r *Runner) Boot() error

func (*Runner) Init added in v1.9.0

func (r *Runner) Init() error

func (*Runner) Run added in v1.3.0

func (r *Runner) Run() error

func (*Runner) StartAPI added in v1.9.0

func (r *Runner) StartAPI() error

Jump to

Keyboard shortcuts

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