exec

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCheckDeadlineExceeded = errors.New("unable to start the check: deadline passed to a check wasn't set, or was negative. This is most likely a misconfiguration(round_duration too small)")
View Source
var ErrPanic = errors.New("panic")
View Source
var ErrUnknownPanic = errors.New("unknown panic")

Functions

func UpdateExecutableProperties

func UpdateExecutableProperties(v Executable, p map[string]string) (err error)

UpdateExecutableProperties sets the properties of a given check by extracting them from map(string) => string, and setting them via reflection.

Types

type Exec

type Exec struct {
	Context context.Context
	Host    string
	// contains filtered or unexported fields
}

func NewExec

func NewExec(ctx context.Context, host string, e Executable) *Exec

func (Exec) Deadline

func (e Exec) Deadline() time.Time

Deadline calculates deadline of a service

func (Exec) Execute

func (e Exec) Execute() (passed bool, log string, err error)

Execute first validates the given check, and if validation passes it executes a given check.

func (Exec) Validate

func (e Exec) Validate() error

Validate validates the service parameters

type Executable

type Executable interface {
	Validate() error
	Execute(e Exec) (passed bool, log string, err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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