Documentation ¶
Index ¶
- type Check
- type CheckConfig
- type CheckFunc
- type ConfigFunc
- type Registry
- func (c *Registry) AddCheck(name string, check Check)
- func (c *Registry) AddFlags(flags *pflag.FlagSet)
- func (c *Registry) Run(ctx context.Context, cg *ctldgraph.ChangeGraph) error
- func (c *Registry) Set(s string) error
- func (c *Registry) SetConfig(conf []config.PreflightRule) error
- func (c *Registry) String() string
- func (c *Registry) Type() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check interface { Enabled() bool SetEnabled(bool) SetConfig(CheckConfig) error Run(context.Context, *ctldgraph.ChangeGraph) error }
type CheckConfig ¶
type CheckFunc ¶
type CheckFunc func(context.Context, *ctldgraph.ChangeGraph, CheckConfig) error
type ConfigFunc ¶
type ConfigFunc func(CheckConfig) error
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is a collection of preflight checks
func NewRegistry ¶
NewRegistry will return a new *Registry with the provided set of preflight checks added to the registry
func (*Registry) AddCheck ¶
AddCheck adds a new preflight check to the registry. The name provided will map to the provided Check.
func (*Registry) AddFlags ¶
AddFlags adds the --preflight flag to a pflag.FlagSet and configures the preflight checks in the registry based on the user provided values. If no values are provided by a user the default values are used.
func (*Registry) Run ¶
Run will execute any enabled preflight checks. The provided Context and ChangeGraph will be passed to the preflight checks that are being executed.
func (*Registry) Set ¶
Set takes in a string in the format of CheckName,... and sets the specified preflight check as enabled if listed, otherwise, sets as disabled if not listed. Returns an error if there is a problem parsing the preflight checks