Documentation ¶
Index ¶
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type AnalyzerShared
- type AnalyzerSpec
- type Condition
- type ConditionShared
- type DockerVersionRequirement
- type EvalCondition
- type EvalOperator
- type KubernetesTotalMemoryRequirement
- type KubernetesVersionRequirement
- type RawRequirement
- type RawSpec
- type Requirement
- type SelinuxNotEnforcingRequirement
Constants ¶
This section is empty.
Variables ¶
var (
DockerVersionRequirementSpecTemplate *template.Template
)
var (
KubernetesTotalMemoryRequirementSpecTemplate *template.Template
)
var (
KubernetesVersionRequirementSpecTemplate *template.Template
)
var (
SelinuxNotEnforcingRequirementSpecTemplate *template.Template
)
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type AnalyzerShared ¶
type AnalyzerShared struct {}
type AnalyzerSpec ¶
type AnalyzerSpec struct { Raw *RawRequirement `json:"raw,omitempty" yaml:"raw,omitempty" hcl:"raw,omitempty"` SelinuxNotEnforcing *SelinuxNotEnforcingRequirement `json:"selinux.notenforcing,omitempty" yaml:"selinux.notenforcing,omitempty" hcl:"selinux.notenforcing,omitempty"` DockerVersion *DockerVersionRequirement `json:"docker.version,omitempty" yaml:"docker.version,omitempty" hcl:"docker.version,omitempty"` KubernetesVersion *KubernetesVersionRequirement `json:"kubernetes.version,omitempty" yaml:"kubernetes.version,omitempty" hcl:"kubernetes.version,omitempty"` KubernetesTotalMemory *KubernetesTotalMemoryRequirement `json:"kubernetes.total-memory,omitempty" yaml:"kubernetes.total-memory,omitempty" hcl:"kubernetes.total-memory,omitempty"` }
AnalyzerSpec is a spec to analyze one or more collect assets
func (AnalyzerSpec) GetRequirement ¶ added in v0.19.2
func (a AnalyzerSpec) GetRequirement() Requirement
type Condition ¶
type Condition struct { Eval *EvalCondition `json:"eval,omitempty" yaml:"eval,omitempty" hcl:"eval,omitempty"` }
type ConditionShared ¶
type ConditionShared struct {}
type DockerVersionRequirement ¶ added in v0.19.2
type DockerVersionRequirement struct {
ServerVersionMin string `json:"server_version_minimum" yaml:"server_version_minimum" hcl:"server_version_minimum"`
}
func (*DockerVersionRequirement) GetRawSpec ¶ added in v0.19.2
func (a *DockerVersionRequirement) GetRawSpec() (RawSpec, error)
func (*DockerVersionRequirement) Validate ¶ added in v0.19.2
func (a *DockerVersionRequirement) Validate(spec AnalyzerSpec) error
type EvalCondition ¶
type EvalCondition struct { Operator EvalOperator `json:"operator,omitempty" yaml:"operator,omitempty" hcl:"operator,omitempty"` Statements []string `json:"statements" yaml:"statements" hcl:"statements"` Variables []map[string]string `json:"variables,omitempty" yaml:"variables,omitempty" hcl:"variables,omitempty"` }
type EvalOperator ¶
type EvalOperator string
const ( AndOperator EvalOperator = "and" OrOperator EvalOperator = "or" )
type KubernetesTotalMemoryRequirement ¶ added in v0.19.2
type KubernetesTotalMemoryRequirement struct {
Min string `json:"minimum" yaml:"minimum" hcl:"minimum"`
}
func (*KubernetesTotalMemoryRequirement) GetRawSpec ¶ added in v0.19.2
func (a *KubernetesTotalMemoryRequirement) GetRawSpec() (RawSpec, error)
func (*KubernetesTotalMemoryRequirement) Validate ¶ added in v0.19.2
func (a *KubernetesTotalMemoryRequirement) Validate(spec AnalyzerSpec) error
type KubernetesVersionRequirement ¶ added in v0.19.2
type KubernetesVersionRequirement struct {
SemverMin string `json:"semver_minimum" yaml:"semver_minimum" hcl:"semver_minimum"`
}
func (*KubernetesVersionRequirement) GetRawSpec ¶ added in v0.19.2
func (a *KubernetesVersionRequirement) GetRawSpec() (RawSpec, error)
func (*KubernetesVersionRequirement) Validate ¶ added in v0.19.2
func (a *KubernetesVersionRequirement) Validate(spec AnalyzerSpec) error
type RawRequirement ¶ added in v0.19.2
type RawRequirement struct {
Conditions []Condition `json:"conditions" yaml:"conditions" hcl:"conditions"`
}
func (*RawRequirement) GetRawSpec ¶ added in v0.19.2
func (r *RawRequirement) GetRawSpec() (RawSpec, error)
func (*RawRequirement) Validate ¶ added in v0.19.2
func (r *RawRequirement) Validate(spec AnalyzerSpec) error
type RawSpec ¶
type RawSpec struct { Raw *RawRequirement `json:"raw,omitempty" yaml:"raw,omitempty" hcl:"raw,omitempty"` }
RawSpec is a translated spec from an AnalyzerSpec
type Requirement ¶ added in v0.19.2
type Requirement interface { Validate(spec AnalyzerSpec) error GetRawSpec() (RawSpec, error) }
type SelinuxNotEnforcingRequirement ¶ added in v0.19.2
type SelinuxNotEnforcingRequirement struct { }
func (*SelinuxNotEnforcingRequirement) GetRawSpec ¶ added in v0.19.2
func (a *SelinuxNotEnforcingRequirement) GetRawSpec() (RawSpec, error)
func (*SelinuxNotEnforcingRequirement) Validate ¶ added in v0.19.2
func (a *SelinuxNotEnforcingRequirement) Validate(spec AnalyzerSpec) error