Documentation
¶
Index ¶
- Constants
- Variables
- type AtomicResolverMutator
- type Operation
- type OperationSet
- type OperationSetOption
- type Query
- type QueryNodeReducer
- type RequiredError
- func (e RequiredError) Code() ValidateErrorType
- func (e RequiredError) Error() string
- func (e RequiredError) Key() string
- func (e RequiredError) Message() string
- func (e RequiredError) Source() string
- func (e RequiredError) SpecName() string
- func (e RequiredError) String() string
- func (e RequiredError) VarItem() *SetVarItem
- type ResolutionFailedError
- func (e ResolutionFailedError) Code() ValidateErrorType
- func (e ResolutionFailedError) Error() string
- func (e ResolutionFailedError) Item() string
- func (e ResolutionFailedError) Key() string
- func (e ResolutionFailedError) Message() string
- func (e ResolutionFailedError) Source() string
- func (e ResolutionFailedError) SpecName() string
- func (e ResolutionFailedError) String() string
- func (e ResolutionFailedError) VarItem() *SetVarItem
- type ResolveOperationSet
- type SetVar
- type SetVarError
- type SetVarItem
- type SetVarItems
- type SetVarSpec
- type SetVarValue
- type Spec
- type SpecDef
- type SpecDefs
- type SpecOperationSet
- type Specs
- type Store
- func (s *Store) DoQuery(query string, vars map[string]interface{}, resolve bool) (*graphql.Result, error)
- func (s *Store) InsecureGet(k string) (string, bool, error)
- func (s *Store) InsecureResolve() (SetVarItems, error)
- func (s *Store) InsecureValues() ([]string, error)
- func (s *Store) LoadEnvs(source string, envs ...string) error
- func (s *Store) NewQuery(queryName, rootSelelection string, varDefs []*ast.VariableDefinition, ...) (*Query, error)
- func (s *Store) SensitiveKeys() ([]string, error)
- func (s *Store) Snapshot() (SetVarItems, error)
- func (s *Store) Update(ctx context.Context, newOrUpdated, deleted []string) error
- type StoreOption
- func WithEnvFile(specFile string, raw []byte) StoreOption
- func WithEnvs(source string, envs ...string) StoreOption
- func WithLogger(logger *zap.Logger) StoreOption
- func WithResolutionCRD(raw []byte) StoreOption
- func WithSpecDefsCRD(raw []byte) StoreOption
- func WithSpecFile(specFile string, raw []byte) StoreOption
- type TagFailedError
- func (e TagFailedError) Code() ValidateErrorType
- func (e TagFailedError) Error() string
- func (e TagFailedError) Item() string
- func (e TagFailedError) Key() string
- func (e TagFailedError) Message() string
- func (e TagFailedError) Source() string
- func (e TagFailedError) SpecName() string
- func (e TagFailedError) String() string
- func (e TagFailedError) Tag() string
- func (e TagFailedError) VarItem() *SetVarItem
- type ValidateErrorType
- type ValidationError
- type ValidationErrors
Constants ¶
View Source
const ( AtomicNameOpaque string = "Opaque" // SpecNameOpaque specifies an opaque specification. AtomicNamePlain string = "Plain" // SpecNamePlain specifies a plain specification. AtomicNameSecret string = "Secret" // SpecNameSecret specifies a secret specification. AtomicNamePassword string = "Password" // SpecNamePassword specifies a password specification. AtomicNameDefault = AtomicNameOpaque )
Constants representing different spec names. These constants are of type AtomicName and are assigned string values.
View Source
const ( OwlEnvSpecDefsKey owlContextKey = iota OwlGcpCredentialsKey )
View Source
const ( DeleteSetOperation setOperationKind = iota LoadSetOperation ReconcileSetOperation ResolveSetOperation TransientSetOperation UpdateSetOperation )
View Source
const SpecTypeKey string = "Spec"
Variables ¶
View Source
var ( Schema graphql.Schema AtomicTypes map[string]*atomicType SpecType *atomicType )
View Source
var EnvironmentType, EnvSpecsType, ValidateType, ResolveType, RenderType, SpecTypeErrorsType *graphql.Object
Functions ¶
This section is empty.
Types ¶
type AtomicResolverMutator ¶
type AtomicResolverMutator func(val *SetVarValue, spec *SetVarSpec, insecure bool)
type OperationSet ¶
type OperationSet struct {
SpecDef
// contains filtered or unexported fields
}
func NewOperationSet ¶
func NewOperationSet(opts ...OperationSetOption) (*OperationSet, error)
type OperationSetOption ¶
type OperationSetOption func(*OperationSet) error
func WithItems ¶
func WithItems(items SetVarItems) OperationSetOption
func WithOperation ¶
func WithOperation(operation setOperationKind) OperationSetOption
func WithSpecs ¶
func WithSpecs(included bool) OperationSetOption
type QueryNodeReducer ¶
type QueryNodeReducer func([]*OperationSet, *ast.OperationDefinition, *ast.SelectionSet) (*ast.SelectionSet, error)
type RequiredError ¶
type RequiredError struct {
// contains filtered or unexported fields
}
func NewRequiredError ¶
func NewRequiredError(varItem *SetVarItem) *RequiredError
func (RequiredError) Code ¶
func (e RequiredError) Code() ValidateErrorType
func (RequiredError) Error ¶
func (e RequiredError) Error() string
func (RequiredError) Key ¶
func (e RequiredError) Key() string
func (RequiredError) Message ¶
func (e RequiredError) Message() string
func (RequiredError) Source ¶
func (e RequiredError) Source() string
func (RequiredError) SpecName ¶
func (e RequiredError) SpecName() string
func (RequiredError) String ¶
func (e RequiredError) String() string
func (RequiredError) VarItem ¶
func (e RequiredError) VarItem() *SetVarItem
type ResolutionFailedError ¶
type ResolutionFailedError struct {
// contains filtered or unexported fields
}
func NewResolutionFailedError ¶
func NewResolutionFailedError(varItem *SetVarItem, item string, err error) *ResolutionFailedError
func (ResolutionFailedError) Code ¶
func (e ResolutionFailedError) Code() ValidateErrorType
func (ResolutionFailedError) Error ¶
func (e ResolutionFailedError) Error() string
func (ResolutionFailedError) Item ¶
func (e ResolutionFailedError) Item() string
func (ResolutionFailedError) Key ¶
func (e ResolutionFailedError) Key() string
func (ResolutionFailedError) Message ¶
func (e ResolutionFailedError) Message() string
func (ResolutionFailedError) Source ¶
func (e ResolutionFailedError) Source() string
func (ResolutionFailedError) SpecName ¶
func (e ResolutionFailedError) SpecName() string
func (ResolutionFailedError) String ¶
func (e ResolutionFailedError) String() string
func (ResolutionFailedError) VarItem ¶
func (e ResolutionFailedError) VarItem() *SetVarItem
type ResolveOperationSet ¶
type ResolveOperationSet struct {
*OperationSet
*SpecOperationSet
Project string
Mapping map[string]string
}
type SetVarError ¶
type SetVarItem ¶
type SetVarItem struct {
Var *SetVar `json:"var,omitempty"`
Value *varValue `json:"value,omitempty"`
Spec *varSpec `json:"spec,omitempty"`
Errors []*SetVarError `json:"errors,omitempty"`
}
type SetVarItems ¶
type SetVarItems []*SetVarItem
type SetVarSpec ¶
type SetVarSpec struct {
Var *SetVar `json:"var,omitempty"`
Spec *varSpec `json:"spec,omitempty"`
}
type SetVarValue ¶
type SetVarValue struct {
Var *SetVar `json:"var,omitempty"`
Value *varValue `json:"value,omitempty"`
}
type Spec ¶
type Spec struct {
Name string
Required bool // Indicates whether the configuration is required.
Valid bool // Indicates whether the configuration is valid.
}
Spec represents the available configuration options and their flags.
type SpecDef ¶
type SpecDef struct {
Name string `json:"name"`
Breaker string `json:"breaker"`
Atomics map[string]*varSpec `json:"atomics" yaml:"-"`
Validator func(item *varSpec, itemKey string, varItem *SetVarItem) (ValidationErrors, error)
}
func (*SpecDef) Validate ¶
func (cd *SpecDef) Validate(itemKey string, varItem *SetVarItem) (ValidationErrors, error)
type SpecOperationSet ¶
type SpecOperationSet struct {
*OperationSet
Name string
Namespace string
Keys []string
}
func (*SpecOperationSet) GetAtomic ¶
func (s *SpecOperationSet) GetAtomic(spec *SetVarSpec, specDefs SpecDefs) (string, *SetVarItem, error)
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewStore ¶
func NewStore(opts ...StoreOption) (*Store, error)
func (*Store) InsecureResolve ¶
func (s *Store) InsecureResolve() (SetVarItems, error)
func (*Store) InsecureValues ¶
func (*Store) NewQuery ¶
func (s *Store) NewQuery(queryName, rootSelelection string, varDefs []*ast.VariableDefinition, reducers []QueryNodeReducer) (*Query, error)
func (*Store) SensitiveKeys ¶
func (*Store) Snapshot ¶
func (s *Store) Snapshot() (SetVarItems, error)
type StoreOption ¶
func WithEnvFile ¶
func WithEnvFile(specFile string, raw []byte) StoreOption
func WithEnvs ¶
func WithEnvs(source string, envs ...string) StoreOption
func WithLogger ¶
func WithLogger(logger *zap.Logger) StoreOption
func WithResolutionCRD ¶
func WithResolutionCRD(raw []byte) StoreOption
func WithSpecDefsCRD ¶
func WithSpecDefsCRD(raw []byte) StoreOption
func WithSpecFile ¶
func WithSpecFile(specFile string, raw []byte) StoreOption
type TagFailedError ¶
type TagFailedError struct {
// contains filtered or unexported fields
}
func NewTagFailedError ¶
func NewTagFailedError(varItem *SetVarItem, tag string, item string) *TagFailedError
func (TagFailedError) Code ¶
func (e TagFailedError) Code() ValidateErrorType
func (TagFailedError) Error ¶
func (e TagFailedError) Error() string
func (TagFailedError) Item ¶
func (e TagFailedError) Item() string
func (TagFailedError) Key ¶
func (e TagFailedError) Key() string
func (TagFailedError) Message ¶
func (e TagFailedError) Message() string
func (TagFailedError) Source ¶
func (e TagFailedError) Source() string
func (TagFailedError) SpecName ¶
func (e TagFailedError) SpecName() string
func (TagFailedError) String ¶
func (e TagFailedError) String() string
func (TagFailedError) Tag ¶
func (e TagFailedError) Tag() string
func (TagFailedError) VarItem ¶
func (e TagFailedError) VarItem() *SetVarItem
type ValidateErrorType ¶
type ValidateErrorType uint8
const ( ValidateErrorVarRequired ValidateErrorType = iota ValidateErrorTagFailed ValidateErrorResolutionFailed )
type ValidationError ¶
type ValidationError interface {
fmt.Stringer
VarItem() *SetVarItem
Error() string
Message() string
Key() string
SpecName() string
Source() string
Code() ValidateErrorType
}
todo(sebastian): perhaps this should be ValueError instead?
type ValidationErrors ¶
type ValidationErrors []ValidationError
func TagValidator ¶
func TagValidator(item *varSpec, itemKey string, varItem *SetVarItem) (ValidationErrors, error)
Click to show internal directories.
Click to hide internal directories.


