Documentation ¶
Index ¶
- Variables
- func NewCheckLog(name string) *log.Entry
- func WaitForFile(filepath string) (*os.File, error)
- type Check
- func NewCheck(name string, checker Checker) Check
- func NewCheckFromHandler(name string, run CheckerHandleRun) Check
- func NewCheckFromHandlerWithCleanUp(name string, run CheckerHandleRun, cleanUp CheckerHandleCleanUp) Check
- func NewCheckFromHandlerWithConfig(name string, conf *config.Config, run CheckerHandleRun) Check
- type Checker
- type CheckerHandleCleanUp
- type CheckerHandleRun
- type ProcessCheck
- type ProcessCheckRunner
- type ProcessChecker
- type ProcessCheckerProcessOutputHandler
Constants ¶
This section is empty.
Variables ¶
var ( // VoidCheckerCleanUp defines a clean up function that does nothing this is usefull // for checks that don't need to do any cleanup when the check finalizes. VoidCheckerCleanUp = func(ctx context.Context, target, assetType, opts string) {} )
Functions ¶
func NewCheckLog ¶
NewCheckLog creates a log suitable to be used by a check
Types ¶
type Check ¶
type Check interface { RunAndServe() Shutdown() error }
Check defines a check as seen by a checker, that is a concrete check implementor.
func NewCheckFromHandler ¶
func NewCheckFromHandler(name string, run CheckerHandleRun) Check
NewCheckFromHandler creates a new check given a checker run handler.
func NewCheckFromHandlerWithCleanUp ¶
func NewCheckFromHandlerWithCleanUp(name string, run CheckerHandleRun, cleanUp CheckerHandleCleanUp) Check
NewCheckFromHandlerWithCleanUp creates a new check given a checker run handler.
func NewCheckFromHandlerWithConfig ¶
func NewCheckFromHandlerWithConfig(name string, conf *config.Config, run CheckerHandleRun) Check
NewCheckFromHandlerWithConfig creates a new check from run and abort handlers using provided config.
type Checker ¶
type Checker interface { Run(ctx context.Context, target, assetType string, opts string, state state.State) error CleanUp(ctx context.Context, target, assetType, opts string) }
Checker defines the shape a checker must have in order to be executed as vulcan-check.
type CheckerHandleCleanUp ¶
CheckerHandleCleanUp func type to specify a CleanUp handler function for a checker.
type CheckerHandleRun ¶
type CheckerHandleRun func(ctx context.Context, target, assetType string, opts string, state state.State) error
CheckerHandleRun func type to specify a Run handler function for a checker.
type ProcessCheck ¶
type ProcessCheck struct {
// contains filtered or unexported fields
}
ProcessCheck simplifies developing a check that runs a process.
func (*ProcessCheck) Run ¶
func (p *ProcessCheck) Run(ctx context.Context) (pState *os.ProcessState, err error)
Run starts the execution of the process.
type ProcessCheckRunner ¶
type ProcessCheckRunner interface {
Run(ctx context.Context) (pState *os.ProcessState, err error)
}
ProcessCheckRunner defines interface a check must implement in order to use the process helper.
func NewProcessChecker ¶
func NewProcessChecker(executable string, args []string, split bufio.SplitFunc, checker ProcessChecker) ProcessCheckRunner
NewProcessChecker creates a new ProcessChecker that launch a process and optionally process the standard output spliting it in chunks defined by a custom bufio.SplitFunc.
type ProcessChecker ¶
ProcessChecker Declares the method a checker must implement in order to use processChecker.
type ProcessCheckerProcessOutputHandler ¶
ProcessCheckerProcessOutputHandler handy adapter to specify a ProcessFinished method deifined in the ProcessChecker interface using a function.
func (ProcessCheckerProcessOutputHandler) ProcessOutputChunk ¶
func (h ProcessCheckerProcessOutputHandler) ProcessOutputChunk(chunk []byte) bool
ProcessOutputChunk handy adapter to specify a ProcessFinished method defined in the ProcessChecker interface using a function.