Documentation ¶
Overview ¶
Package hook provides standardised way to trigger hooks and provide values at different points in execution
Index ¶
Constants ¶
const CombinedType = "combined"
CombinedType is the type of the CombinedExecute; designed to link together multiple executers and to provide a simplified single entry point
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CombinedExecute ¶
type CombinedExecute struct {
Executers []Executer
}
CombinedExecute is an executer that contains subexecuters that it will forward hook requests to; designed to link together multiple executers and to provide a simplified single entry point
func (*CombinedExecute) ExecuteWithValue ¶
func (e *CombinedExecute) ExecuteWithValue(definition *Definition, value string) (string, error)
ExecuteWithValue takes in a hook definition and a value to pass, it will look at the stored sub executers and decide which executer to use for the hook provided
func (*CombinedExecute) GetType ¶
func (e *CombinedExecute) GetType() string
GetType returns the CombinedExecute type
type Definition ¶
type Definition struct { Type string `json:"type"` Timeout int `json:"timeout"` Shell *Shell `json:"shell"` HTTP *HTTP `json:"http"` }
Definition describes a hook for passing data/triggering logic, such as through a shell command
type Executer ¶
type Executer interface { ExecuteWithValue(definition *Definition, value string) (string, error) GetType() string }
Executer interface provides methods for executing user logic with a value passed through to it