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 Analyzer
- type AnalyzerShared
- type AnalyzerSpec
- type Condition
- type ConditionShared
- type EvalCondition
- type EvalOperator
- type KubernetesTotalMemoryAnalyzer
- type KubernetesVersionAnalyzer
- type RawAnalyzer
Constants ¶
This section is empty.
Variables ¶
var (
KubernetesTotalMemoryAnalyzerSpecTemplate *template.Template
)
var (
KubernetesVersionAnalyzerSpecTemplate *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 Analyzer ¶
type Analyzer interface { Validate(spec AnalyzerSpec) error GetSpec() (AnalyzerSpec, error) }
type AnalyzerShared ¶
type AnalyzerShared struct {}
type AnalyzerSpec ¶
type AnalyzerSpec struct { KubernetesVersion *KubernetesVersionAnalyzer `json:"kubernetes.version,omitempty" yaml:"kubernetes.version,omitempty" hcl:"kubernetes.version,omitempty"` KubernetesTotalMemory *KubernetesTotalMemoryAnalyzer `json:"kubernetes.total-memory,omitempty" yaml:"kubernetes.total-memory,omitempty" hcl:"kubernetes.total-memory,omitempty"` Raw *RawAnalyzer `json:"raw,omitempty" yaml:"raw,omitempty" hcl:"raw,omitempty"` }
Analyzer is a spec to generate one or more deployment assets
func (AnalyzerSpec) GetAnalyzer ¶
func (a AnalyzerSpec) GetAnalyzer() Analyzer
type Condition ¶
type Condition struct { Eval *EvalCondition `json:"eval,omitempty" yaml:"eval,omitempty" hcl:"eval,omitempty"` }
type ConditionShared ¶
type ConditionShared struct {}
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 KubernetesTotalMemoryAnalyzer ¶
type KubernetesTotalMemoryAnalyzer struct { Severity common.Severity `json:"severity,omitempty" yaml:"severity,omitempty" hcl:"severity,omitempty"` Min string `json:"minimum" yaml:"minimum" hcl:"minimum"` }
func (*KubernetesTotalMemoryAnalyzer) GetSpec ¶
func (a *KubernetesTotalMemoryAnalyzer) GetSpec() (AnalyzerSpec, error)
func (*KubernetesTotalMemoryAnalyzer) Validate ¶
func (a *KubernetesTotalMemoryAnalyzer) Validate(spec AnalyzerSpec) error
type KubernetesVersionAnalyzer ¶
type KubernetesVersionAnalyzer struct { Severity common.Severity `json:"severity,omitempty" yaml:"severity,omitempty" hcl:"severity,omitempty"` SemverMin string `json:"semver_minimum" yaml:"semver_minimum" hcl:"semver_minimum"` }
func (*KubernetesVersionAnalyzer) GetSpec ¶
func (a *KubernetesVersionAnalyzer) GetSpec() (AnalyzerSpec, error)
func (*KubernetesVersionAnalyzer) Validate ¶
func (a *KubernetesVersionAnalyzer) Validate(spec AnalyzerSpec) error
type RawAnalyzer ¶
type RawAnalyzer struct {
Conditions []Condition `json:"conditions" yaml:"conditions" hcl:"conditions"`
}
func (*RawAnalyzer) GetSpec ¶
func (a *RawAnalyzer) GetSpec() (AnalyzerSpec, error)
func (*RawAnalyzer) Validate ¶
func (a *RawAnalyzer) Validate(spec AnalyzerSpec) error