Documentation ¶
Index ¶
- func AllError(results []ValidationResult) error
- func GetMap(raw interface{}, ids ...string) (map[string]interface{}, bool)
- func GetSlice(raw interface{}, id ...string) (interface{}, bool)
- func GetSliceOfMaps(raw interface{}, id ...string) ([]map[string]interface{}, bool)
- func GetSliceOfStrings(raw interface{}, id ...string) ([]string, bool)
- func GetString(raw interface{}, ids ...string) (string, bool)
- func ToInt(raw interface{}) (int64, bool)
- type Checker
- type NetworkChecker
- type NetworkExtraPropertiesChecker
- type Result
- type SlsStateExtended
- type ValidationCheck
- type ValidationResult
- func FailureResult(id ValidationCheck, componentId string, description string) ValidationResult
- func NewValidationResult(result Result, id ValidationCheck, componentId string, description string) ValidationResult
- func PassResult(id ValidationCheck, componentId string, description string) ValidationResult
- func WarningResult(id ValidationCheck, componentId string, description string) ValidationResult
- type ValidationResults
- func (v *ValidationResults) Add(results ...ValidationResult) *ValidationResults
- func (v *ValidationResults) Fail(id ValidationCheck, componentId string, description string)
- func (v *ValidationResults) GetResults() []ValidationResult
- func (v *ValidationResults) Pass(id ValidationCheck, componentId string, description string)
- func (v *ValidationResults) ToError() error
- func (v *ValidationResults) ToString() string
- func (v *ValidationResults) Warning(id ValidationCheck, componentId string, description string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllError ¶
func AllError(results []ValidationResult) error
func GetSliceOfMaps ¶
Returns a list of maps
func GetSliceOfStrings ¶
Types ¶
type Checker ¶
type Checker interface {
Validate(results *ValidationResults)
}
type NetworkChecker ¶
type NetworkChecker interface { Add(network *sls_client.Network) Validate(results *ValidationResults) }
type NetworkExtraPropertiesChecker ¶
type NetworkExtraPropertiesChecker interface { Add(properties *sls_client.NetworkExtraProperties) Validate(results *ValidationResults) }
type SlsStateExtended ¶
type SlsStateExtended struct { SlsState *sls_client.SlsState TypeToHardware map[string][]*sls_client.Hardware // This contains all the xnames that are specified as parents in the hardware entries. // This is currently treated as a set (a map with no meaningful value) // If something needs to look up hardware by parent, then change this to a map // for example change to: ParentToChildren map[string][]*sls_client.Hardware ParentHasChildren map[string]struct{} // todo remove these if they are not used AliasToHardware map[string]*sls_client.Hardware IPReservationNameToNetworks map[string][]*sls_client.Network HardwareTypeToAlias map[string]map[string]*sls_client.Hardware NetworkToIPReservations map[string][]map[string]string }
func NewSlsStateExtended ¶
func NewSlsStateExtended(slsState *sls_client.SlsState) *SlsStateExtended
type ValidationCheck ¶
type ValidationCheck string
const ( IPRangeConflictCheck ValidationCheck = "ip-range-conflict" IPRangeConflictWithK8sCheck ValidationCheck = "ip-range-conflict-with-k8s" SLSSchemaCheck ValidationCheck = "sls-schema-validation" )
type ValidationResult ¶
type ValidationResult struct { Result Result CheckID ValidationCheck ComponentID string Description string }
func FailureResult ¶
func FailureResult(id ValidationCheck, componentId string, description string) ValidationResult
func NewValidationResult ¶
func NewValidationResult(result Result, id ValidationCheck, componentId string, description string) ValidationResult
func PassResult ¶
func PassResult(id ValidationCheck, componentId string, description string) ValidationResult
func WarningResult ¶
func WarningResult(id ValidationCheck, componentId string, description string) ValidationResult
type ValidationResults ¶
type ValidationResults struct {
// contains filtered or unexported fields
}
func NewValidationResults ¶
func NewValidationResults() *ValidationResults
func (*ValidationResults) Add ¶
func (v *ValidationResults) Add(results ...ValidationResult) *ValidationResults
func (*ValidationResults) Fail ¶
func (v *ValidationResults) Fail(id ValidationCheck, componentId string, description string)
func (*ValidationResults) GetResults ¶
func (v *ValidationResults) GetResults() []ValidationResult
func (*ValidationResults) Pass ¶
func (v *ValidationResults) Pass(id ValidationCheck, componentId string, description string)
func (*ValidationResults) ToError ¶
func (v *ValidationResults) ToError() error
func (*ValidationResults) ToString ¶ added in v0.2.0
func (v *ValidationResults) ToString() string
func (*ValidationResults) Warning ¶
func (v *ValidationResults) Warning(id ValidationCheck, componentId string, description string)
Click to show internal directories.
Click to hide internal directories.