Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TestModes = map[string]string{
"ent": "Nomad Autoscaler Enterprise",
"pro": "Nomad Autoscaler Pro",
"expert": "Nomad Autoscaler Expert",
}
Functions ¶
This section is empty.
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
Checker verifies if a set of CLI flags or the fields of an HCL struct object follow the required mode rules.
func NewChecker ¶
NewChecker returns a new Checker with the given modes, some of them enabled.
func (*Checker) Flag ¶
Flag wraps the function call to set a flag to register it wit specific modes requirements.
func (*Checker) ValidateFlags ¶
ValidateFlags validates that all flags that have been set fulfill the mode requirements.
func (*Checker) ValidateStruct ¶
ValidateStruct validates if the non-zero fields of a struct follow the mode requirement set for them.
type TestDeepNested ¶
type TestDeepNested struct {
DeepNestedPro bool `hcl:"deep_nested_pro" modes:"pro"`
}
type TestNestedStruct ¶
type TestNestedStruct struct { NestedField bool `hcl:"nested_field_none"` NestedFieldEnt bool `hcl:"nested_field_ent" modes:"ent"` DeepNested *TestDeepNested `hcl:"deep_nested,block"` }
type TestStruct ¶
type TestStruct struct { TopLevelNone bool `hcl:"top_level_none"` TopLevelEnt bool `hcl:"top_level_ent" modes:"ent"` TopLevelExpert bool `hcl:"top_level_expert" modes:"expert"` TopLevelEntOrExpert bool `hcl:"top_level_ent_expert" modes:"ent,expert"` TopLevelPro bool `hcl:"top_level_pro" modes:"pro"` NestedNone *TestNestedStruct `hcl:"nested_none,block"` NestedPro *TestNestedStruct `hcl:"nested_pro,block" modes:"pro"` NestedProExpert *TestNestedStruct `hcl:"nested_pro_expert,block" modes:"pro,expert"` NonPointerNestedEnt TestNestedStruct `hcl:"non_pointer_nested_ent,block" modes:"ent"` NestedMultiple []*TestNestedStruct `hcl:"nested_multiple,block"` }
func NewTestStruct ¶
func NewTestStruct() *TestStruct
func NewTestStructFull ¶
func NewTestStructFull() *TestStruct
Click to show internal directories.
Click to hide internal directories.