runner

package
v0.0.0-...-68ccc1b Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MapStatus = map[Status]string{
	Unknown:     "unknown",
	Running:     "running",
	RunnerError: "runner_error",
	Offline:     "offline",
}

Functions

func GetCapabilities

func GetCapabilities() ([]byte, error)

Types

type Runner

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

func New

func New(logger *zap.Logger, policyName string, policyDir string) Runner

func (*Runner) Configure

func (r *Runner) Configure(c *config.Policy) error

func (*Runner) FullReset

func (r *Runner) FullReset(ctx context.Context) error

func (*Runner) GetStatus

func (r *Runner) GetStatus() State

func (*Runner) Start

func (r *Runner) Start(ctx context.Context, cancelFunc context.CancelFunc) error

func (*Runner) Stop

func (r *Runner) Stop(ctx context.Context) error

type RunnerOutput

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

func (*RunnerOutput) Write

func (rs *RunnerOutput) Write(p []byte) (n int, err error)

type State

type State struct {
	Status     Status `yaml:"-"`
	StatusText string `yaml:"status"`

	RestartCount  int64     `yaml:"restart_count"`
	LastLog       string    `yaml:"-"`
	LastError     string    `yaml:"last_error"`
	LastRestartTS time.Time `yaml:"last_restart_time"`
	// contains filtered or unexported fields
}

type Status

type Status int
const (
	Unknown Status = iota
	Running
	RunnerError
	Offline
)

Jump to

Keyboard shortcuts

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