Documentation ¶
Index ¶
- type API
- type APICheck
- type Check
- type Checker
- type State
- func (p *State) SetEndTime(t time.Time)
- func (p *State) SetProgress(progress float32)
- func (p *State) SetStartTime(t time.Time)
- func (p *State) SetStatusAborted()
- func (p *State) SetStatusFailed(err error)
- func (p *State) SetStatusFinished()
- func (p *State) SetStatusInconclusive()
- func (p *State) SetStatusRunning()
- func (p *State) Shutdown() error
- func (p *State) State() (state *agent.State)
- type StatePusher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APICheck ¶
type APICheck interface {
Abort() error
}
APICheck represents the checker the push api communicates with. This is usefull to write unit tests because makes mocking dependencies of this component easier.
type Check ¶
Check stores the 'pieces' needed to run a checker.
func NewCheckWithConfig ¶
func NewCheckWithConfig(name string, checker Checker, logger *log.Entry, conf *config.Config) *Check
NewCheckWithConfig creates a check with a given configuration
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 State ¶
type State struct {
// contains filtered or unexported fields
}
State implements a state that uses a pusher to send state changes to an agent. This implementation is NOT SYNCHRONIZED, that is not not suitable to be be used by multiple goroutines
func (*State) SetEndTime ¶
SetEndTime sets the time when the check has finished. This method does not send notification to the agent.
func (*State) SetProgress ¶
SetProgress sets the progress of the current state, but only if the status is agent.StatusRunning and progress has increased. This method sends a notification to the agent.
func (*State) SetStartTime ¶
SetStartTime sets the time when the check started. This method does not send notification to the agent.
func (*State) SetStatusAborted ¶
func (p *State) SetStatusAborted()
SetStatusAborted sets the state of the current check to Running and the progress to 1.0. This method sends a notification to the agent.
func (*State) SetStatusFailed ¶
SetStatusFailed sets the state of the current check to Running and the progress to 1.0 This method sends a notification to the agent.
func (*State) SetStatusFinished ¶
func (p *State) SetStatusFinished()
SetStatusFinished sets the state of the current check to Running and the progress to 1.0. This method sends a notification to the agent.
func (*State) SetStatusInconclusive ¶
func (p *State) SetStatusInconclusive()
SetStatusInconclusive sets the state of the current check to Inconclusive and the progress to 1.0 This method sends a notification to the agent.
func (*State) SetStatusRunning ¶
func (p *State) SetStatusRunning()
SetStatusRunning sets the state of the current check to Running and the progress to 1.0.
type StatePusher ¶
type StatePusher interface { UpdateState(state interface{}) Shutdown() error }
StatePusher defines the shape a pusher communications component must satisfy in order to be used by the PushState. This is usefull to write unit tests because makes mocking dependencies of this component easier.