Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check interface { // Validate checks whether the asset enforces the check. Validate(image string, logger *logrus.Logger) (result bool, err error) // Name returns the name of the check. Name() string // Metadata returns the check's metadata. Metadata() Metadata // Help return the check's help text. Help() HelpText }
Check as an interface containing all methods necessary to use and identify a given check.
func NewGenericCheck ¶
func NewGenericCheck( name string, validatorFn ValidatorFunc, metadata Metadata, helptext HelpText) Check
NewGenericCheck returns a basic check implementation with the provided inputs. This is to enable a quick way to add additional checks to the default checks already enforced.
Developers can always define structs with internal keys and methods, and have that fulfill the Check interface. However, if no internal data or methods are needed, then this generic check provides an easier, purely-functional approach.
type HelpText ¶
type HelpText struct { Message string `json:"message" xml:"message"` Suggestion string `json:"suggestion" xml:"suggestion"` }
HelpText is the help message associated with any given check
type Metadata ¶
type Metadata struct { Description string `json:"description" xml:"description"` Level string `json:"level" xml:"level"` KnowledgeBaseURL string `json:"knowledge_base_url,omitempty" xml:"knowledgeBaseURL"` CheckURL string `json:"check_url,omitempty" xml:"checkURL"` }
Metadata contains useful information regarding the check
Click to show internal directories.
Click to hide internal directories.