certification

package
v0.0.0-...-efc9761 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

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 CheckInfo

type CheckInfo struct {
	Metadata `json:"metadata" xml:"metadata"`
	HelpText `json:"helptext"`
}

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

type ValidatorFunc

type ValidatorFunc = func(string, *logrus.Logger) (bool, error)

ValidatorFunc describes a function that, when executed, will check that an artifact (e.g. operator bundle) complies with a given check.

Directories

Path Synopsis
internal
shell
package shell contains check implementations that rely on utilizing shell commands directly through the use of cmd.Exec.
package shell contains check implementations that rely on utilizing shell commands directly through the use of cmd.Exec.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL