owl

package
v3.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

README ¶

+++ [runme] id = '01HRA297WC2HJP7X48FM3DR1V0' version = 'v3' +++

The Owl Store 🦉

...aka smart ENV store. A better solution to specify, validate, and resolve a user's or workload's environment. Because:

Owl Store

The owl 🦉 is wise and knows environment variables aren't just for workloads they are for humans, too.

Documentation ¶

Index ¶

Constants ¶

View Source
const (
	SpecNameOpaque   string = "Opaque"   // SpecNameOpaque specifies an opaque specification.
	SpecNamePlain    string = "Plain"    // SpecNamePlain specifies a plain specification.
	SpecNameSecret   string = "Secret"   // SpecNameSecret specifies a secret specification.
	SpecNamePassword string = "Password" // SpecNamePassword specifies a password specification.
	SpecNameDefault         = SpecNameOpaque
)

Constants representing different specification names. These constants are of type SpecName and are assigned string values.

View Source
const (
	LoadSetOperation setOperationKind = iota
	UpdateSetOperation
	DeleteSetOperation
	ReconcileSetOperation
	TransientSetOperation
)

Variables ¶

View Source
var (
	Schema    graphql.Schema
	SpecTypes map[string]*specType
)
View Source
var EnvironmentType,
	ValidateType,
	RenderType,
	SpecTypeErrorsType *graphql.Object

Functions ¶

This section is empty.

Types ¶

type Operation ¶

type Operation struct {
	// contains filtered or unexported fields
}

type OperationSet ¶

type OperationSet struct {
	// contains filtered or unexported fields
}

func NewOperationSet ¶

func NewOperationSet(opts ...OperationSetOption) (*OperationSet, error)

type OperationSetOption ¶

type OperationSetOption func(*OperationSet) error

func WithOperation ¶

func WithOperation(operation setOperationKind) OperationSetOption

func WithSpecs ¶

func WithSpecs(included bool) OperationSetOption

type Query ¶

type Query struct {
	// contains filtered or unexported fields
}

func NewQuery ¶

func NewQuery(name string, varDefs []*ast.VariableDefinition, reducers []QueryNodeReducer) (*Query, error)

func (*Query) Print ¶

func (q *Query) Print() (string, error)

type RequiredError ¶ added in v3.2.1

type RequiredError struct {
	// contains filtered or unexported fields
}

func NewRequiredError ¶ added in v3.2.1

func NewRequiredError(varItem *SetVarItem) *RequiredError

func (RequiredError) Code ¶ added in v3.2.1

func (RequiredError) Error ¶ added in v3.2.1

func (e RequiredError) Error() string

func (RequiredError) Key ¶ added in v3.2.1

func (e RequiredError) Key() string

func (RequiredError) Message ¶ added in v3.2.1

func (e RequiredError) Message() string

func (RequiredError) Source ¶ added in v3.2.1

func (e RequiredError) Source() string

func (RequiredError) SpecName ¶ added in v3.2.1

func (e RequiredError) SpecName() string

func (RequiredError) String ¶ added in v3.2.1

func (e RequiredError) String() string

func (RequiredError) VarItem ¶ added in v3.2.1

func (e RequiredError) VarItem() *SetVarItem

type SetVar ¶

type SetVar struct {
	Key    string `json:"key"`
	Origin string `json:"origin,omitempty"`
	// Operation *setVarOperation `json:"operation"`
	Created *time.Time `json:"created,omitempty"`
	Updated *time.Time `json:"updated,omitempty"`
}

type SetVarError ¶ added in v3.2.1

type SetVarError struct {
	Code    int    `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

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 SpecResolverMutator ¶

type SpecResolverMutator func(val *SetVarValue, spec *SetVarSpec, insecure bool)

type Specs ¶

type Specs map[string]Spec

Specs represents a collection of configuration specifications.

func ParseRawSpec ¶

func ParseRawSpec(values map[string]string, comments map[string]string) Specs

GenerateSpecsFromComments maps comments to configuration key specifications.

type Store ¶

type Store struct {
	// contains filtered or unexported fields
}

func NewStore ¶

func NewStore(opts ...StoreOption) (*Store, error)

func (*Store) InsecureValues ¶

func (s *Store) InsecureValues() ([]string, error)

func (*Store) SensitiveKeys ¶ added in v3.2.2

func (s *Store) SensitiveKeys() ([]string, error)

func (*Store) Snapshot ¶

func (s *Store) Snapshot() (SetVarItems, error)

func (*Store) Update ¶

func (s *Store) Update(newOrUpdated, deleted []string) error

type StoreOption ¶

type StoreOption func(*Store) error

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 WithSpecFile ¶

func WithSpecFile(specFile string, raw []byte) StoreOption

type ValidateErrorType ¶ added in v3.2.1

type ValidateErrorType uint8
const (
	ValidateErrorVarRequired ValidateErrorType = iota
)

type ValidationError ¶ added in v3.2.1

type ValidationError interface {
	fmt.Stringer
	VarItem() *SetVarItem
	Error() string
	Message() string
	Key() string
	SpecName() string
	Source() string
	Code() ValidateErrorType
}

type ValidationErrors ¶ added in v3.2.1

type ValidationErrors []ValidationError

Jump to

Keyboard shortcuts

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