Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnknownCheckerType = errors.New("Unknown checker name")
ErrUnknownCheckerType is the error returned when the factory can't create a checker because type is not registered
Functions ¶
func Register ¶
func Register(name string, factory CheckerFactory)
Register will be use to register a new checker from a name and a factory function
func RenderError ¶ added in v1.1.0
RenderError allow personalised rendering if checker contains a template
Types ¶
type Checker ¶
type Checker interface { Name() string ServiceName() string Periodicity() *time.Duration Run(context.Context) Result }
Checker is the interface that allow to perform checks
func CreateChecker ¶
CreateChecker instantiates registered checker into a single instance
type CheckerFactory ¶
CheckerFactory is the function interface to creates a checker instance
type Result ¶
type Result struct { // Status indicates if check was successful or not Status StatusEnum // Message is the additional message that can be given to Consumer server Message string // Checker is the checker that returns this result Checker Checker }
Result is the structure that represents a checker result
type StatusEnum ¶
type StatusEnum int16
StatusEnum corresponds to all status for a Consumer message
const ( // STATE_OK represents a healthy service STATE_OK StatusEnum = nsca.STATE_OK // STATE_WARNING represents a service that requires attention STATE_WARNING StatusEnum = nsca.STATE_WARNING // STATE_CRITICAL represents a service that needs immediate fix STATE_CRITICAL StatusEnum = nsca.STATE_CRITICAL // STATE_UNKNOWN represents a service in an unsure status STATE_UNKNOWN StatusEnum = nsca.STATE_UNKNOWN )
Click to show internal directories.
Click to hide internal directories.