configreader

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Bool

func Bool(inter interface{}, v *BoolValidation) (bool, error)

func BoolFromEnv

func BoolFromEnv(envVarName string, v *BoolValidation) (bool, error)

func BoolFromEnvOrFile

func BoolFromEnvOrFile(envVarName string, filePath string, v *BoolValidation) (bool, error)

func BoolFromFile

func BoolFromFile(filePath string, v *BoolValidation) (bool, error)

func BoolFromInterfaceMap

func BoolFromInterfaceMap(key string, iMap map[string]interface{}, v *BoolValidation) (bool, error)

func BoolFromPrompt

func BoolFromPrompt(promptOpts *PromptOptions, v *BoolValidation) (bool, error)

func BoolFromStr

func BoolFromStr(valStr string, v *BoolValidation) (bool, error)

func BoolFromStrMap

func BoolFromStrMap(key string, sMap map[string]string, v *BoolValidation) (bool, error)

func BoolList

func BoolList(inter interface{}, v *BoolListValidation) ([]bool, error)

func BoolListFromInterfaceMap

func BoolListFromInterfaceMap(key string, iMap map[string]interface{}, v *BoolListValidation) ([]bool, error)

func BoolPtr

func BoolPtr(inter interface{}, v *BoolPtrValidation) (*bool, error)

func BoolPtrFromEnv

func BoolPtrFromEnv(envVarName string, v *BoolPtrValidation) (*bool, error)

func BoolPtrFromEnvOrFile

func BoolPtrFromEnvOrFile(envVarName string, filePath string, v *BoolPtrValidation) (*bool, error)

func BoolPtrFromFile

func BoolPtrFromFile(filePath string, v *BoolPtrValidation) (*bool, error)

func BoolPtrFromInterfaceMap

func BoolPtrFromInterfaceMap(key string, iMap map[string]interface{}, v *BoolPtrValidation) (*bool, error)

func BoolPtrFromPrompt

func BoolPtrFromPrompt(promptOpts *PromptOptions, v *BoolPtrValidation) (*bool, error)

func BoolPtrFromStr

func BoolPtrFromStr(valStr string, v *BoolPtrValidation) (*bool, error)

func BoolPtrFromStrMap

func BoolPtrFromStrMap(key string, sMap map[string]string, v *BoolPtrValidation) (*bool, error)

func EmailValidator added in v0.9.0

func EmailValidator() func(string) (string, error)

func EnvVar added in v0.4.0

func EnvVar(envVarName string) string

func ErrorAlphaNumericDashDotUnderscore added in v0.4.0

func ErrorAlphaNumericDashDotUnderscore(provided string) error

func ErrorAlphaNumericDashUnderscore added in v0.4.0

func ErrorAlphaNumericDashUnderscore(provided string) error

func ErrorCannotBeEmpty added in v0.4.0

func ErrorCannotBeEmpty() error

func ErrorCannotBeNull added in v0.4.0

func ErrorCannotBeNull() error

func ErrorCannotSetStructField added in v0.4.0

func ErrorCannotSetStructField() error

func ErrorCortexResourceNotAllowed added in v0.4.0

func ErrorCortexResourceNotAllowed(resourceName string) error

func ErrorCortexResourceOnlyAllowed added in v0.4.0

func ErrorCortexResourceOnlyAllowed(invalidStr string) error

func ErrorDuplicatedValue added in v0.4.0

func ErrorDuplicatedValue(val interface{}) error

func ErrorInvalidFloat32 added in v0.4.0

func ErrorInvalidFloat32(provided float32, allowed ...float32) error

func ErrorInvalidFloat64 added in v0.4.0

func ErrorInvalidFloat64(provided float64, allowed ...float64) error

func ErrorInvalidInt added in v0.4.0

func ErrorInvalidInt(provided int, allowed ...int) error

func ErrorInvalidInt32 added in v0.4.0

func ErrorInvalidInt32(provided int32, allowed ...int32) error

func ErrorInvalidInt64 added in v0.4.0

func ErrorInvalidInt64(provided int64, allowed ...int64) error

func ErrorInvalidInterface added in v0.4.0

func ErrorInvalidInterface(provided interface{}, allowed ...interface{}) error

func ErrorInvalidPrimitiveType added in v0.4.0

func ErrorInvalidPrimitiveType(provided interface{}, allowedTypes ...PrimitiveType) error

func ErrorInvalidStr added in v0.4.0

func ErrorInvalidStr(provided string, allowed ...string) error

func ErrorInvalidYAML added in v0.4.0

func ErrorInvalidYAML(err error) error

func ErrorMapMustBeDefined added in v0.4.0

func ErrorMapMustBeDefined(keys ...string) error

func ErrorMustBeDefined added in v0.4.0

func ErrorMustBeDefined() error

func ErrorMustBeEmpty added in v0.4.0

func ErrorMustBeEmpty() error

func ErrorMustBeGreaterThan added in v0.4.0

func ErrorMustBeGreaterThan(provided interface{}, boundary interface{}) error

func ErrorMustBeGreaterThanOrEqualTo added in v0.4.0

func ErrorMustBeGreaterThanOrEqualTo(provided interface{}, boundary interface{}) error

func ErrorMustBeLessThan added in v0.4.0

func ErrorMustBeLessThan(provided interface{}, boundary interface{}) error

func ErrorMustBeLessThanOrEqualTo added in v0.4.0

func ErrorMustBeLessThanOrEqualTo(provided interface{}, boundary interface{}) error

func ErrorMustHavePrefix added in v0.4.0

func ErrorMustHavePrefix(provided string, prefix string) error

func ErrorUnsupportedKey added in v0.4.0

func ErrorUnsupportedKey(key interface{}) error

func FlattenAllStrValues added in v0.4.0

func FlattenAllStrValues(obj interface{}) ([]string, error)

FlattenAllStrValues assumes that the order for maps is deterministic

func FlattenAllStrValuesAsSet added in v0.4.0

func FlattenAllStrValuesAsSet(obj interface{}) (strset.Set, error)

func Float32

func Float32(inter interface{}, v *Float32Validation) (float32, error)

func Float32FromEnv

func Float32FromEnv(envVarName string, v *Float32Validation) (float32, error)

func Float32FromEnvOrFile

func Float32FromEnvOrFile(envVarName string, filePath string, v *Float32Validation) (float32, error)

func Float32FromFile

func Float32FromFile(filePath string, v *Float32Validation) (float32, error)

func Float32FromInterfaceMap

func Float32FromInterfaceMap(key string, iMap map[string]interface{}, v *Float32Validation) (float32, error)

func Float32FromPrompt

func Float32FromPrompt(promptOpts *PromptOptions, v *Float32Validation) (float32, error)

func Float32FromStr

func Float32FromStr(valStr string, v *Float32Validation) (float32, error)

func Float32FromStrMap

func Float32FromStrMap(key string, sMap map[string]string, v *Float32Validation) (float32, error)

func Float32List

func Float32List(inter interface{}, v *Float32ListValidation) ([]float32, error)

func Float32ListFromInterfaceMap

func Float32ListFromInterfaceMap(key string, iMap map[string]interface{}, v *Float32ListValidation) ([]float32, error)

func Float32Ptr

func Float32Ptr(inter interface{}, v *Float32PtrValidation) (*float32, error)

func Float32PtrFromEnv

func Float32PtrFromEnv(envVarName string, v *Float32PtrValidation) (*float32, error)

func Float32PtrFromEnvOrFile

func Float32PtrFromEnvOrFile(envVarName string, filePath string, v *Float32PtrValidation) (*float32, error)

func Float32PtrFromFile

func Float32PtrFromFile(filePath string, v *Float32PtrValidation) (*float32, error)

func Float32PtrFromInterfaceMap

func Float32PtrFromInterfaceMap(key string, iMap map[string]interface{}, v *Float32PtrValidation) (*float32, error)

func Float32PtrFromPrompt

func Float32PtrFromPrompt(promptOpts *PromptOptions, v *Float32PtrValidation) (*float32, error)

func Float32PtrFromStr

func Float32PtrFromStr(valStr string, v *Float32PtrValidation) (*float32, error)

func Float32PtrFromStrMap

func Float32PtrFromStrMap(key string, sMap map[string]string, v *Float32PtrValidation) (*float32, error)

func Float64

func Float64(inter interface{}, v *Float64Validation) (float64, error)

func Float64FromEnv

func Float64FromEnv(envVarName string, v *Float64Validation) (float64, error)

func Float64FromEnvOrFile

func Float64FromEnvOrFile(envVarName string, filePath string, v *Float64Validation) (float64, error)

func Float64FromFile

func Float64FromFile(filePath string, v *Float64Validation) (float64, error)

func Float64FromInterfaceMap

func Float64FromInterfaceMap(key string, iMap map[string]interface{}, v *Float64Validation) (float64, error)

func Float64FromPrompt

func Float64FromPrompt(promptOpts *PromptOptions, v *Float64Validation) (float64, error)

func Float64FromStr

func Float64FromStr(valStr string, v *Float64Validation) (float64, error)

func Float64FromStrMap

func Float64FromStrMap(key string, sMap map[string]string, v *Float64Validation) (float64, error)

func Float64List

func Float64List(inter interface{}, v *Float64ListValidation) ([]float64, error)

func Float64ListFromInterfaceMap

func Float64ListFromInterfaceMap(key string, iMap map[string]interface{}, v *Float64ListValidation) ([]float64, error)

func Float64Ptr

func Float64Ptr(inter interface{}, v *Float64PtrValidation) (*float64, error)

func Float64PtrFromEnv

func Float64PtrFromEnv(envVarName string, v *Float64PtrValidation) (*float64, error)

func Float64PtrFromEnvOrFile

func Float64PtrFromEnvOrFile(envVarName string, filePath string, v *Float64PtrValidation) (*float64, error)

func Float64PtrFromFile

func Float64PtrFromFile(filePath string, v *Float64PtrValidation) (*float64, error)

func Float64PtrFromInterfaceMap

func Float64PtrFromInterfaceMap(key string, iMap map[string]interface{}, v *Float64PtrValidation) (*float64, error)

func Float64PtrFromPrompt

func Float64PtrFromPrompt(promptOpts *PromptOptions, v *Float64PtrValidation) (*float64, error)

func Float64PtrFromStr

func Float64PtrFromStr(valStr string, v *Float64PtrValidation) (*float64, error)

func Float64PtrFromStrMap

func Float64PtrFromStrMap(key string, sMap map[string]string, v *Float64PtrValidation) (*float64, error)

func GetFilePathValidator added in v0.4.0

func GetFilePathValidator(baseDir string) func(string) (string, error)

func GetS3PathValidator added in v0.4.0

func GetS3PathValidator() func(string) (string, error)

func GetS3aPathValidator added in v0.4.0

func GetS3aPathValidator() func(string) (string, error)

func GetURLValidator added in v0.4.0

func GetURLValidator(defaultHTTP bool, addPort bool) func(string) (string, error)

uses https unless defaultHTTP == true

func Int

func Int(inter interface{}, v *IntValidation) (int, error)

func Int32

func Int32(inter interface{}, v *Int32Validation) (int32, error)

func Int32FromEnv

func Int32FromEnv(envVarName string, v *Int32Validation) (int32, error)

func Int32FromEnvOrFile

func Int32FromEnvOrFile(envVarName string, filePath string, v *Int32Validation) (int32, error)

func Int32FromFile

func Int32FromFile(filePath string, v *Int32Validation) (int32, error)

func Int32FromInterfaceMap

func Int32FromInterfaceMap(key string, iMap map[string]interface{}, v *Int32Validation) (int32, error)

func Int32FromPrompt

func Int32FromPrompt(promptOpts *PromptOptions, v *Int32Validation) (int32, error)

func Int32FromStr

func Int32FromStr(valStr string, v *Int32Validation) (int32, error)

func Int32FromStrMap

func Int32FromStrMap(key string, sMap map[string]string, v *Int32Validation) (int32, error)

func Int32List

func Int32List(inter interface{}, v *Int32ListValidation) ([]int32, error)

func Int32ListFromInterfaceMap

func Int32ListFromInterfaceMap(key string, iMap map[string]interface{}, v *Int32ListValidation) ([]int32, error)

func Int32Ptr

func Int32Ptr(inter interface{}, v *Int32PtrValidation) (*int32, error)

func Int32PtrFromEnv

func Int32PtrFromEnv(envVarName string, v *Int32PtrValidation) (*int32, error)

func Int32PtrFromEnvOrFile

func Int32PtrFromEnvOrFile(envVarName string, filePath string, v *Int32PtrValidation) (*int32, error)

func Int32PtrFromFile

func Int32PtrFromFile(filePath string, v *Int32PtrValidation) (*int32, error)

func Int32PtrFromInterfaceMap

func Int32PtrFromInterfaceMap(key string, iMap map[string]interface{}, v *Int32PtrValidation) (*int32, error)

func Int32PtrFromPrompt

func Int32PtrFromPrompt(promptOpts *PromptOptions, v *Int32PtrValidation) (*int32, error)

func Int32PtrFromStr

func Int32PtrFromStr(valStr string, v *Int32PtrValidation) (*int32, error)

func Int32PtrFromStrMap

func Int32PtrFromStrMap(key string, sMap map[string]string, v *Int32PtrValidation) (*int32, error)

func Int64

func Int64(inter interface{}, v *Int64Validation) (int64, error)

func Int64FromEnv

func Int64FromEnv(envVarName string, v *Int64Validation) (int64, error)

func Int64FromEnvOrFile

func Int64FromEnvOrFile(envVarName string, filePath string, v *Int64Validation) (int64, error)

func Int64FromFile

func Int64FromFile(filePath string, v *Int64Validation) (int64, error)

func Int64FromInterfaceMap

func Int64FromInterfaceMap(key string, iMap map[string]interface{}, v *Int64Validation) (int64, error)

func Int64FromPrompt

func Int64FromPrompt(promptOpts *PromptOptions, v *Int64Validation) (int64, error)

func Int64FromStr

func Int64FromStr(valStr string, v *Int64Validation) (int64, error)

func Int64FromStrMap

func Int64FromStrMap(key string, sMap map[string]string, v *Int64Validation) (int64, error)

func Int64List

func Int64List(inter interface{}, v *Int64ListValidation) ([]int64, error)

func Int64ListFromInterfaceMap

func Int64ListFromInterfaceMap(key string, iMap map[string]interface{}, v *Int64ListValidation) ([]int64, error)

func Int64Ptr

func Int64Ptr(inter interface{}, v *Int64PtrValidation) (*int64, error)

func Int64PtrFromEnv

func Int64PtrFromEnv(envVarName string, v *Int64PtrValidation) (*int64, error)

func Int64PtrFromEnvOrFile

func Int64PtrFromEnvOrFile(envVarName string, filePath string, v *Int64PtrValidation) (*int64, error)

func Int64PtrFromFile

func Int64PtrFromFile(filePath string, v *Int64PtrValidation) (*int64, error)

func Int64PtrFromInterfaceMap

func Int64PtrFromInterfaceMap(key string, iMap map[string]interface{}, v *Int64PtrValidation) (*int64, error)

func Int64PtrFromPrompt

func Int64PtrFromPrompt(promptOpts *PromptOptions, v *Int64PtrValidation) (*int64, error)

func Int64PtrFromStr

func Int64PtrFromStr(valStr string, v *Int64PtrValidation) (*int64, error)

func Int64PtrFromStrMap

func Int64PtrFromStrMap(key string, sMap map[string]string, v *Int64PtrValidation) (*int64, error)

func IntFromEnv

func IntFromEnv(envVarName string, v *IntValidation) (int, error)

func IntFromEnvOrFile

func IntFromEnvOrFile(envVarName string, filePath string, v *IntValidation) (int, error)

func IntFromFile

func IntFromFile(filePath string, v *IntValidation) (int, error)

func IntFromInterfaceMap

func IntFromInterfaceMap(key string, iMap map[string]interface{}, v *IntValidation) (int, error)

func IntFromPrompt

func IntFromPrompt(promptOpts *PromptOptions, v *IntValidation) (int, error)

func IntFromStr

func IntFromStr(valStr string, v *IntValidation) (int, error)

func IntFromStrMap

func IntFromStrMap(key string, sMap map[string]string, v *IntValidation) (int, error)

func IntList

func IntList(inter interface{}, v *IntListValidation) ([]int, error)

func IntListFromInterfaceMap

func IntListFromInterfaceMap(key string, iMap map[string]interface{}, v *IntListValidation) ([]int, error)

func IntPtr

func IntPtr(inter interface{}, v *IntPtrValidation) (*int, error)

func IntPtrFromEnv

func IntPtrFromEnv(envVarName string, v *IntPtrValidation) (*int, error)

func IntPtrFromEnvOrFile

func IntPtrFromEnvOrFile(envVarName string, filePath string, v *IntPtrValidation) (*int, error)

func IntPtrFromFile

func IntPtrFromFile(filePath string, v *IntPtrValidation) (*int, error)

func IntPtrFromInterfaceMap

func IntPtrFromInterfaceMap(key string, iMap map[string]interface{}, v *IntPtrValidation) (*int, error)

func IntPtrFromPrompt

func IntPtrFromPrompt(promptOpts *PromptOptions, v *IntPtrValidation) (*int, error)

func IntPtrFromStr

func IntPtrFromStr(valStr string, v *IntPtrValidation) (*int, error)

func IntPtrFromStrMap

func IntPtrFromStrMap(key string, sMap map[string]string, v *IntPtrValidation) (*int, error)

func Interface

func Interface(inter interface{}, v *InterfaceValidation) (interface{}, error)

func InterfaceFromInterfaceMap

func InterfaceFromInterfaceMap(key string, iMap map[string]interface{}, v *InterfaceValidation) (interface{}, error)

func InterfaceMap

func InterfaceMap(inter interface{}, v *InterfaceMapValidation) (map[string]interface{}, error)

func InterfaceMapFromInterfaceMap

func InterfaceMapFromInterfaceMap(key string, iMap map[string]interface{}, v *InterfaceMapValidation) (map[string]interface{}, error)

func InterfaceMapList

func InterfaceMapList(inter interface{}, v *InterfaceMapListValidation) ([]map[string]interface{}, error)

func InterfaceMapListFromInterfaceMap

func InterfaceMapListFromInterfaceMap(key string, iMap map[string]interface{}, v *InterfaceMapListValidation) ([]map[string]interface{}, error)

func InterfaceStruct

func InterfaceStruct(inter interface{}, v *InterfaceStructValidation) (interface{}, []error)

func InterfaceStructList

func InterfaceStructList(dest interface{}, inter interface{}, v *InterfaceStructListValidation) (interface{}, []error)

func MustBoolFromEnv

func MustBoolFromEnv(envVarName string, v *BoolValidation) bool

func MustBoolFromEnvOrFile

func MustBoolFromEnvOrFile(envVarName string, filePath string, v *BoolValidation) bool

func MustBoolFromFile

func MustBoolFromFile(filePath string, v *BoolValidation) bool

func MustFloat32FromEnv

func MustFloat32FromEnv(envVarName string, v *Float32Validation) float32

func MustFloat32FromEnvOrFile

func MustFloat32FromEnvOrFile(envVarName string, filePath string, v *Float32Validation) float32

func MustFloat32FromFile

func MustFloat32FromFile(filePath string, v *Float32Validation) float32

func MustFloat64FromEnv

func MustFloat64FromEnv(envVarName string, v *Float64Validation) float64

func MustFloat64FromEnvOrFile

func MustFloat64FromEnvOrFile(envVarName string, filePath string, v *Float64Validation) float64

func MustFloat64FromFile

func MustFloat64FromFile(filePath string, v *Float64Validation) float64

func MustInt32FromEnv

func MustInt32FromEnv(envVarName string, v *Int32Validation) int32

func MustInt32FromEnvOrFile

func MustInt32FromEnvOrFile(envVarName string, filePath string, v *Int32Validation) int32

func MustInt32FromFile

func MustInt32FromFile(filePath string, v *Int32Validation) int32

func MustInt64FromEnv

func MustInt64FromEnv(envVarName string, v *Int64Validation) int64

func MustInt64FromEnvOrFile

func MustInt64FromEnvOrFile(envVarName string, filePath string, v *Int64Validation) int64

func MustInt64FromFile

func MustInt64FromFile(filePath string, v *Int64Validation) int64

func MustIntFromEnv

func MustIntFromEnv(envVarName string, v *IntValidation) int

func MustIntFromEnvOrFile

func MustIntFromEnvOrFile(envVarName string, filePath string, v *IntValidation) int

func MustIntFromFile

func MustIntFromFile(filePath string, v *IntValidation) int

func MustReadJSONStr

func MustReadJSONStr(jsonStr string) interface{}

func MustReadYAMLStr

func MustReadYAMLStr(yamlStr string) interface{}

func MustReadYAMLStrMap

func MustReadYAMLStrMap(yamlStr string) map[string]interface{}

func MustStringFromEnv

func MustStringFromEnv(envVarName string, v *StringValidation) string

func MustStringFromEnvOrFile

func MustStringFromEnvOrFile(envVarName string, filePath string, v *StringValidation) string

func MustStringFromFile

func MustStringFromFile(filePath string, v *StringValidation) string

func ReadEnvVar

func ReadEnvVar(envVarName string) *string

func ReadInterfaceMapValue

func ReadInterfaceMapValue(name string, interMap map[string]interface{}) (interface{}, bool)

func ReadJSONBytes

func ReadJSONBytes(jsonBytes []byte) (interface{}, error)

func ReadPrompt

func ReadPrompt(dest interface{}, promptValidation *PromptValidation) error

func ReadYAMLBytes

func ReadYAMLBytes(yamlBytes []byte) (interface{}, error)

func String

func String(inter interface{}, v *StringValidation) (string, error)

func StringFromEnv

func StringFromEnv(envVarName string, v *StringValidation) (string, error)

func StringFromEnvOrFile

func StringFromEnvOrFile(envVarName string, filePath string, v *StringValidation) (string, error)

func StringFromFile

func StringFromFile(filePath string, v *StringValidation) (string, error)

func StringFromInterfaceMap

func StringFromInterfaceMap(key string, iMap map[string]interface{}, v *StringValidation) (string, error)

func StringFromPrompt

func StringFromPrompt(promptOpts *PromptOptions, v *StringValidation) (string, error)

func StringFromStr

func StringFromStr(valStr string, v *StringValidation) (string, error)

func StringFromStrMap

func StringFromStrMap(key string, sMap map[string]string, v *StringValidation) (string, error)

func StringList

func StringList(inter interface{}, v *StringListValidation) ([]string, error)

func StringListFromInterfaceMap

func StringListFromInterfaceMap(key string, iMap map[string]interface{}, v *StringListValidation) ([]string, error)

func StringMap

func StringMap(inter interface{}, v *StringMapValidation) (map[string]string, error)

func StringMapFromInterfaceMap

func StringMapFromInterfaceMap(key string, iMap map[string]interface{}, v *StringMapValidation) (map[string]string, error)

func StringPtr

func StringPtr(inter interface{}, v *StringPtrValidation) (*string, error)

func StringPtrFromEnv

func StringPtrFromEnv(envVarName string, v *StringPtrValidation) (*string, error)

func StringPtrFromEnvOrFile

func StringPtrFromEnvOrFile(envVarName string, filePath string, v *StringPtrValidation) (*string, error)

func StringPtrFromFile

func StringPtrFromFile(filePath string, v *StringPtrValidation) (*string, error)

func StringPtrFromInterfaceMap

func StringPtrFromInterfaceMap(key string, iMap map[string]interface{}, v *StringPtrValidation) (*string, error)

func StringPtrFromPrompt

func StringPtrFromPrompt(promptOpts *PromptOptions, v *StringPtrValidation) (*string, error)

func StringPtrFromStr

func StringPtrFromStr(str string, v *StringPtrValidation) (*string, error)

func StringPtrFromStrMap

func StringPtrFromStrMap(key string, sMap map[string]string, v *StringPtrValidation) (*string, error)

func Struct

func Struct(dest interface{}, inter interface{}, v *StructValidation) []error

func StructList

func StructList(dest interface{}, inter interface{}, v *StructListValidation) (interface{}, []error)

func ValidateBool

func ValidateBool(val bool, v *BoolValidation) (bool, error)

func ValidateBoolListMissing

func ValidateBoolListMissing(v *BoolListValidation) ([]bool, error)

func ValidateBoolListProvided added in v0.4.0

func ValidateBoolListProvided(val []bool, v *BoolListValidation) ([]bool, error)

func ValidateBoolMissing

func ValidateBoolMissing(v *BoolValidation) (bool, error)

func ValidateBoolPtrMissing

func ValidateBoolPtrMissing(v *BoolPtrValidation) (*bool, error)

func ValidateBoolPtrProvided added in v0.4.0

func ValidateBoolPtrProvided(val *bool, v *BoolPtrValidation) (*bool, error)

func ValidateFloat32

func ValidateFloat32(val float32, v *Float32Validation) (float32, error)

func ValidateFloat32ListMissing

func ValidateFloat32ListMissing(v *Float32ListValidation) ([]float32, error)

func ValidateFloat32ListProvided added in v0.4.0

func ValidateFloat32ListProvided(val []float32, v *Float32ListValidation) ([]float32, error)

func ValidateFloat32Missing

func ValidateFloat32Missing(v *Float32Validation) (float32, error)

func ValidateFloat32PtrMissing

func ValidateFloat32PtrMissing(v *Float32PtrValidation) (*float32, error)

func ValidateFloat32PtrProvided added in v0.4.0

func ValidateFloat32PtrProvided(val *float32, v *Float32PtrValidation) (*float32, error)

func ValidateFloat32Val

func ValidateFloat32Val(val float32, v *Float32Validation) error

func ValidateFloat64

func ValidateFloat64(val float64, v *Float64Validation) (float64, error)

func ValidateFloat64ListMissing

func ValidateFloat64ListMissing(v *Float64ListValidation) ([]float64, error)

func ValidateFloat64ListProvided added in v0.4.0

func ValidateFloat64ListProvided(val []float64, v *Float64ListValidation) ([]float64, error)

func ValidateFloat64Missing

func ValidateFloat64Missing(v *Float64Validation) (float64, error)

func ValidateFloat64PtrMissing

func ValidateFloat64PtrMissing(v *Float64PtrValidation) (*float64, error)

func ValidateFloat64PtrProvided added in v0.4.0

func ValidateFloat64PtrProvided(val *float64, v *Float64PtrValidation) (*float64, error)

func ValidateFloat64Val

func ValidateFloat64Val(val float64, v *Float64Validation) error

func ValidateInt

func ValidateInt(val int, v *IntValidation) (int, error)

func ValidateInt32

func ValidateInt32(val int32, v *Int32Validation) (int32, error)

func ValidateInt32ListMissing

func ValidateInt32ListMissing(v *Int32ListValidation) ([]int32, error)

func ValidateInt32ListProvided added in v0.4.0

func ValidateInt32ListProvided(val []int32, v *Int32ListValidation) ([]int32, error)

func ValidateInt32Missing

func ValidateInt32Missing(v *Int32Validation) (int32, error)

func ValidateInt32PtrMissing

func ValidateInt32PtrMissing(v *Int32PtrValidation) (*int32, error)

func ValidateInt32PtrProvdied added in v0.4.0

func ValidateInt32PtrProvdied(val *int32, v *Int32PtrValidation) (*int32, error)

func ValidateInt32Val

func ValidateInt32Val(val int32, v *Int32Validation) error

func ValidateInt64

func ValidateInt64(val int64, v *Int64Validation) (int64, error)

func ValidateInt64ListMissing

func ValidateInt64ListMissing(v *Int64ListValidation) ([]int64, error)

func ValidateInt64ListProvided added in v0.4.0

func ValidateInt64ListProvided(val []int64, v *Int64ListValidation) ([]int64, error)

func ValidateInt64Missing

func ValidateInt64Missing(v *Int64Validation) (int64, error)

func ValidateInt64PtrMissing

func ValidateInt64PtrMissing(v *Int64PtrValidation) (*int64, error)

func ValidateInt64PtrProvided added in v0.4.0

func ValidateInt64PtrProvided(val *int64, v *Int64PtrValidation) (*int64, error)

func ValidateInt64Val

func ValidateInt64Val(val int64, v *Int64Validation) error

func ValidateIntListMissing

func ValidateIntListMissing(v *IntListValidation) ([]int, error)

func ValidateIntListProvided added in v0.4.0

func ValidateIntListProvided(val []int, v *IntListValidation) ([]int, error)

func ValidateIntMissing

func ValidateIntMissing(v *IntValidation) (int, error)

func ValidateIntPtrMissing

func ValidateIntPtrMissing(v *IntPtrValidation) (*int, error)

func ValidateIntPtrProvided added in v0.4.0

func ValidateIntPtrProvided(val *int, v *IntPtrValidation) (*int, error)

func ValidateIntVal

func ValidateIntVal(val int, v *IntValidation) error

func ValidateInterfaceMapListMissing

func ValidateInterfaceMapListMissing(v *InterfaceMapListValidation) ([]map[string]interface{}, error)

func ValidateInterfaceMapListProvided added in v0.4.0

func ValidateInterfaceMapListProvided(val []map[string]interface{}, v *InterfaceMapListValidation) ([]map[string]interface{}, error)

func ValidateInterfaceMapMissing

func ValidateInterfaceMapMissing(v *InterfaceMapValidation) (map[string]interface{}, error)

func ValidateInterfaceMapProvided added in v0.4.0

func ValidateInterfaceMapProvided(val map[string]interface{}, v *InterfaceMapValidation) (map[string]interface{}, error)

func ValidateInterfaceMissing

func ValidateInterfaceMissing(v *InterfaceValidation) (interface{}, error)

func ValidateInterfaceProvided added in v0.4.0

func ValidateInterfaceProvided(val interface{}, v *InterfaceValidation) (interface{}, error)

func ValidateString

func ValidateString(val string, v *StringValidation) (string, error)

func ValidateStringListMissing

func ValidateStringListMissing(v *StringListValidation) ([]string, error)

func ValidateStringListProvided added in v0.4.0

func ValidateStringListProvided(val []string, v *StringListValidation) ([]string, error)

func ValidateStringMapMissing

func ValidateStringMapMissing(v *StringMapValidation) (map[string]string, error)

func ValidateStringMapProvided added in v0.4.0

func ValidateStringMapProvided(val map[string]string, v *StringMapValidation) (map[string]string, error)

func ValidateStringMissing

func ValidateStringMissing(v *StringValidation) (string, error)

func ValidateStringPtrMissing

func ValidateStringPtrMissing(v *StringPtrValidation) (*string, error)

func ValidateStringPtrProvided added in v0.4.0

func ValidateStringPtrProvided(val *string, v *StringPtrValidation) (*string, error)

func ValidateStringVal

func ValidateStringVal(val string, v *StringValidation) error

Types

type BoolListValidation

type BoolListValidation struct {
	Required          bool
	Default           []bool
	AllowExplicitNull bool
	AllowEmpty        bool
	Validator         func([]bool) ([]bool, error)
}

type BoolPtrValidation

type BoolPtrValidation struct {
	Required          bool
	Default           *bool
	AllowExplicitNull bool
}

type BoolValidation

type BoolValidation struct {
	Required bool
	Default  bool
}

type Error added in v0.4.0

type Error struct {
	Kind ErrorKind
	// contains filtered or unexported fields
}

func (Error) Error added in v0.4.0

func (e Error) Error() string

type ErrorKind added in v0.4.0

type ErrorKind int
const (
	ErrUnknown ErrorKind = iota
	ErrUnsupportedKey
	ErrInvalidYAML
	ErrAlphaNumericDashUnderscore
	ErrAlphaNumericDashDotUnderscore
	ErrMustHavePrefix
	ErrInvalidInterface
	ErrInvalidFloat64
	ErrInvalidFloat32
	ErrInvalidInt64
	ErrInvalidInt32
	ErrInvalidInt
	ErrInvalidStr
	ErrMustBeLessThanOrEqualTo
	ErrMustBeLessThan
	ErrMustBeGreaterThanOrEqualTo
	ErrMustBeGreaterThan
	ErrInvalidPrimitiveType
	ErrDuplicatedValue
	ErrCannotSetStructField
	ErrCannotBeNull
	ErrCannotBeEmpty
	ErrMustBeDefined
	ErrMapMustBeDefined
	ErrMustBeEmpty
	ErrCortexResourceOnlyAllowed
	ErrCortexResourceNotAllowed
)

func (ErrorKind) MarshalBinary added in v0.4.0

func (t ErrorKind) MarshalBinary() ([]byte, error)

MarshalBinary satisfies BinaryMarshaler

func (ErrorKind) MarshalText added in v0.4.0

func (t ErrorKind) MarshalText() ([]byte, error)

MarshalText satisfies TextMarshaler

func (ErrorKind) String added in v0.4.0

func (t ErrorKind) String() string

func (*ErrorKind) UnmarshalBinary added in v0.4.0

func (t *ErrorKind) UnmarshalBinary(data []byte) error

UnmarshalBinary satisfies BinaryUnmarshaler Needed for msgpack

func (*ErrorKind) UnmarshalText added in v0.4.0

func (t *ErrorKind) UnmarshalText(text []byte) error

UnmarshalText satisfies TextUnmarshaler

type Float32ListValidation

type Float32ListValidation struct {
	Required          bool
	Default           []float32
	AllowExplicitNull bool
	AllowEmpty        bool
	Validator         func([]float32) ([]float32, error)
}

type Float32PtrValidation

type Float32PtrValidation struct {
	Required             bool
	Default              *float32
	AllowExplicitNull    bool
	AllowedValues        []float32
	GreaterThan          *float32
	GreaterThanOrEqualTo *float32
	LessThan             *float32
	LessThanOrEqualTo    *float32
	Validator            func(float32) (float32, error)
}

type Float32Validation

type Float32Validation struct {
	Required             bool
	Default              float32
	AllowedValues        []float32
	GreaterThan          *float32
	GreaterThanOrEqualTo *float32
	LessThan             *float32
	LessThanOrEqualTo    *float32
	Validator            func(float32) (float32, error)
}

type Float64ListValidation

type Float64ListValidation struct {
	Required          bool
	Default           []float64
	AllowExplicitNull bool
	AllowEmpty        bool
	Validator         func([]float64) ([]float64, error)
}

type Float64PtrValidation

type Float64PtrValidation struct {
	Required             bool
	Default              *float64
	AllowExplicitNull    bool
	AllowedValues        []float64
	GreaterThan          *float64
	GreaterThanOrEqualTo *float64
	LessThan             *float64
	LessThanOrEqualTo    *float64
	Validator            func(float64) (float64, error)
}

type Float64Validation

type Float64Validation struct {
	Required             bool
	Default              float64
	AllowedValues        []float64
	GreaterThan          *float64
	GreaterThanOrEqualTo *float64
	LessThan             *float64
	LessThanOrEqualTo    *float64
	Validator            func(float64) (float64, error)
}

type Int32ListValidation

type Int32ListValidation struct {
	Required          bool
	Default           []int32
	AllowExplicitNull bool
	AllowEmpty        bool
	Validator         func([]int32) ([]int32, error)
}

type Int32PtrValidation

type Int32PtrValidation struct {
	Required             bool
	Default              *int32
	AllowExplicitNull    bool
	AllowedValues        []int32
	GreaterThan          *int32
	GreaterThanOrEqualTo *int32
	LessThan             *int32
	LessThanOrEqualTo    *int32
	Validator            func(int32) (int32, error)
}

type Int32Validation

type Int32Validation struct {
	Required             bool
	Default              int32
	AllowedValues        []int32
	GreaterThan          *int32
	GreaterThanOrEqualTo *int32
	LessThan             *int32
	LessThanOrEqualTo    *int32
	Validator            func(int32) (int32, error)
}

type Int64ListValidation

type Int64ListValidation struct {
	Required          bool
	Default           []int64
	AllowExplicitNull bool
	AllowEmpty        bool
	Validator         func([]int64) ([]int64, error)
}

type Int64PtrValidation

type Int64PtrValidation struct {
	Required             bool
	Default              *int64
	AllowExplicitNull    bool
	AllowedValues        []int64
	GreaterThan          *int64
	GreaterThanOrEqualTo *int64
	LessThan             *int64
	LessThanOrEqualTo    *int64
	Validator            func(int64) (int64, error)
}

type Int64Validation

type Int64Validation struct {
	Required             bool
	Default              int64
	AllowedValues        []int64
	GreaterThan          *int64
	GreaterThanOrEqualTo *int64
	LessThan             *int64
	LessThanOrEqualTo    *int64
	Validator            func(int64) (int64, error)
}

type IntListValidation

type IntListValidation struct {
	Required          bool
	Default           []int
	AllowExplicitNull bool
	AllowEmpty        bool
	Validator         func([]int) ([]int, error)
}

type IntPtrValidation

type IntPtrValidation struct {
	Required             bool
	Default              *int
	AllowExplicitNull    bool
	AllowedValues        []int
	GreaterThan          *int
	GreaterThanOrEqualTo *int
	LessThan             *int
	LessThanOrEqualTo    *int
	Validator            func(int) (int, error)
}

type IntValidation

type IntValidation struct {
	Required             bool
	Default              int
	AllowedValues        []int
	GreaterThan          *int
	GreaterThanOrEqualTo *int
	LessThan             *int
	LessThanOrEqualTo    *int
	Validator            func(int) (int, error)
}

type InterfaceMapListValidation

type InterfaceMapListValidation struct {
	Required               bool
	Default                []map[string]interface{}
	AllowExplicitNull      bool
	AllowEmpty             bool
	AllowCortexResources   bool
	RequireCortexResources bool
	Validator              func([]map[string]interface{}) ([]map[string]interface{}, error)
}

type InterfaceMapValidation

type InterfaceMapValidation struct {
	Required               bool
	Default                map[string]interface{}
	AllowExplicitNull      bool
	AllowEmpty             bool
	ScalarsOnly            bool
	StringLeavesOnly       bool
	AllowedLeafValues      []string
	AllowCortexResources   bool
	RequireCortexResources bool
	Validator              func(map[string]interface{}) (map[string]interface{}, error)
}

type InterfaceStructListValidation

type InterfaceStructListValidation struct {
	InterfaceStructValidation *InterfaceStructValidation
	Required                  bool
	AllowExplicitNull         bool
	ShortCircuit              bool
}

type InterfaceStructType

type InterfaceStructType struct {
	Type                   interface{} // e.g. (*MyType)(nil)
	StructFieldValidations []*StructFieldValidation
}

type InterfaceStructValidation

type InterfaceStructValidation struct {
	TypeKey                    string                               // required
	TypeStructField            string                               // optional (will set this field if present)
	InterfaceStructTypes       map[string]*InterfaceStructType      // specify this or ParsedInterfaceStructTypes
	ParsedInterfaceStructTypes map[interface{}]*InterfaceStructType // must specify Parser if using this
	Parser                     func(string) (interface{}, error)
	Required                   bool
	AllowExplicitNull          bool
	ShortCircuit               bool
	AllowExtraFields           bool
}

type InterfaceValidation

type InterfaceValidation struct {
	Required               bool
	Default                interface{}
	AllowExplicitNull      bool
	AllowCortexResources   bool
	RequireCortexResources bool
	Validator              func(interface{}) (interface{}, error)
}

type PrimitiveType added in v0.4.0

type PrimitiveType string
var (
	PrimTypeInt        PrimitiveType = "integer"
	PrimTypeIntList    PrimitiveType = "integer list"
	PrimTypeFloat      PrimitiveType = "float"
	PrimTypeFloatList  PrimitiveType = "float list"
	PrimTypeString     PrimitiveType = "string"
	PrimTypeStringList PrimitiveType = "string list"
	PrimTypeBool       PrimitiveType = "boolean"
	PrimTypeBoolList   PrimitiveType = "boolean list"

	PrimTypeMap     PrimitiveType = "map"
	PrimTypeMapList PrimitiveType = "list of maps"
	PrimTypeList    PrimitiveType = "list"

	PrimTypeStringToStringMap PrimitiveType = "map of strings to strings"
)

type PrimitiveTypes added in v0.4.0

type PrimitiveTypes []PrimitiveType

func (PrimitiveTypes) StringList added in v0.4.0

func (ts PrimitiveTypes) StringList() []string

type PromptItemValidation

type PromptItemValidation struct {
	StructField string         // Required
	PromptOpts  *PromptOptions // Required

	// Provide one of the following:
	StringValidation  *StringValidation
	BoolValidation    *BoolValidation
	IntValidation     *IntValidation
	Int32Validation   *Int32Validation
	Int64Validation   *Int64Validation
	Float32Validation *Float32Validation
	Float64Validation *Float64Validation
}

type PromptOptions

type PromptOptions struct {
	Prompt        string
	MaskDefault   bool
	HideTyping    bool
	MaskTyping    bool
	TypingMaskVal string
	// contains filtered or unexported fields
}

type PromptValidation

type PromptValidation struct {
	PromptItemValidations []*PromptItemValidation
}

type StringListValidation

type StringListValidation struct {
	Required               bool
	Default                []string
	AllowExplicitNull      bool
	AllowEmpty             bool
	DisallowDups           bool
	AllowCortexResources   bool
	RequireCortexResources bool
	Validator              func([]string) ([]string, error)
}

type StringMapValidation

type StringMapValidation struct {
	Required               bool
	Default                map[string]string
	AllowExplicitNull      bool
	AllowEmpty             bool
	AllowCortexResources   bool
	RequireCortexResources bool
	Validator              func(map[string]string) (map[string]string, error)
}

type StringPtrValidation

type StringPtrValidation struct {
	Required                      bool
	Default                       *string
	AllowExplicitNull             bool
	AllowEmpty                    bool
	AllowedValues                 []string
	Prefix                        string
	AlphaNumericDashDotUnderscore bool
	AlphaNumericDashUnderscore    bool
	DNS1035                       bool
	DNS1123                       bool
	CastScalar                    bool
	CastNumeric                   bool
	AllowCortexResources          bool
	RequireCortexResources        bool
	Validator                     func(string) (string, error)
}

type StringValidation

type StringValidation struct {
	Required                             bool
	Default                              string
	AllowEmpty                           bool
	AllowedValues                        []string
	Prefix                               string
	AlphaNumericDashDotUnderscoreOrEmpty bool
	AlphaNumericDashDotUnderscore        bool
	AlphaNumericDashUnderscore           bool
	DNS1035                              bool
	DNS1123                              bool
	CastNumeric                          bool
	CastScalar                           bool
	AllowCortexResources                 bool
	RequireCortexResources               bool
	Validator                            func(string) (string, error)
}

type StructFieldValidation

type StructFieldValidation struct {
	Key              string                        // Required, defaults to json key or "StructField"
	StructField      string                        // Required
	DefaultField     string                        // Optional. Will set the default to the runtime value of this field
	DefaultFieldFunc func(interface{}) interface{} // Optional. Will call the func with the value of DefaultField

	// Provide one of the following:
	StringValidation              *StringValidation
	StringPtrValidation           *StringPtrValidation
	StringListValidation          *StringListValidation
	BoolValidation                *BoolValidation
	BoolPtrValidation             *BoolPtrValidation
	BoolListValidation            *BoolListValidation
	IntValidation                 *IntValidation
	IntPtrValidation              *IntPtrValidation
	IntListValidation             *IntListValidation
	Int32Validation               *Int32Validation
	Int32PtrValidation            *Int32PtrValidation
	Int32ListValidation           *Int32ListValidation
	Int64Validation               *Int64Validation
	Int64PtrValidation            *Int64PtrValidation
	Int64ListValidation           *Int64ListValidation
	Float32Validation             *Float32Validation
	Float32PtrValidation          *Float32PtrValidation
	Float32ListValidation         *Float32ListValidation
	Float64Validation             *Float64Validation
	Float64PtrValidation          *Float64PtrValidation
	Float64ListValidation         *Float64ListValidation
	StringMapValidation           *StringMapValidation
	InterfaceMapValidation        *InterfaceMapValidation
	InterfaceMapListValidation    *InterfaceMapListValidation
	InterfaceValidation           *InterfaceValidation
	StructValidation              *StructValidation
	StructListValidation          *StructListValidation
	InterfaceStructValidation     *InterfaceStructValidation
	InterfaceStructListValidation *InterfaceStructListValidation
	Nil                           bool

	// Additional parsing step for StringValidation or StringPtrValidation
	Parser func(string) (interface{}, error)
}

type StructListValidation

type StructListValidation struct {
	StructValidation  *StructValidation
	Required          bool
	AllowExplicitNull bool
	ShortCircuit      bool
}

type StructValidation

type StructValidation struct {
	StructFieldValidations []*StructFieldValidation
	Required               bool
	AllowExplicitNull      bool
	DefaultNil             bool // If this struct is nested and its key is not defined, set it to nil instead of defaults or erroring (e.g. if any subfields are required)
	ShortCircuit           bool
	AllowExtraFields       bool
}

type TypePlaceholder

type TypePlaceholder struct {
	Type string `json:"type"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL