Documentation ¶
Index ¶
- Variables
- type Backend
- type DecodeError
- type MultiError
- type Store
- func (s *Store) DeleteSchema(name string) error
- func (s *Store) DeleteValue(schemaName, fieldName string) error
- func (s *Store) DeleteValues(schemaName string) error
- func (s *Store) ListSchemas() ([]*app.Schema, error)
- func (s *Store) RetrieveSchema(name string) (*app.Schema, error)
- func (s *Store) RetrieveValue(schemaName, fieldName string) (interface{}, error)
- func (s *Store) RetrieveValues(schemaName string) (map[string]interface{}, error)
- func (s *Store) StoreDefaultValues(schemaName string) error
- func (s *Store) StoreSchema(name string, schema *app.Schema) error
- func (s *Store) StoreValue(schemaName, fieldName string, value interface{}) error
- func (s *Store) StoreValues(schemaName string, values map[string]interface{}) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrFieldRequired is returned when a field is required and receives a // request to be deleted. ErrFieldRequired = errors.New("field is required") // ErrMissingKey is returned when a key is missing ErrMissingKey = errors.New("key not found") // ErrMissingField is returned when a field is missing ErrMissingField = errors.New("no such field") // ErrMissingBackend is returned with a given backend is not found ErrMissingBackend = errors.New("backend not found") )
Functions ¶
This section is empty.
Types ¶
type Backend ¶
Backend stores information about keys under backend, plus a name for the backend.
func NewBackend ¶
NewBackend wraps a backend for use in a store
type DecodeError ¶
DecodeError is returned for errors in decoding values
func (*DecodeError) Error ¶
func (d *DecodeError) Error() string
type MultiError ¶
type MultiError struct {
// contains filtered or unexported fields
}
MultiError is multiple errors rolled into one
func NewMultiError ¶
func NewMultiError(errs ...error) *MultiError
NewMultiError wraps a number of errors in a MutliError
func (*MultiError) Append ¶
func (m *MultiError) Append(err error)
Append adds a new error onto the end of the MultiError
func (*MultiError) Error ¶
func (m *MultiError) Error() string
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store stores and validates schemas.
func FromConfig ¶
FromConfig loads a Store from config bytes
func (*Store) DeleteSchema ¶
DeleteSchema removes a schema from the K/V tree
func (*Store) DeleteValue ¶
DeleteValue deletes a single value or sets it back to the default. If the value is required and does not have a default, this method will return an error.
func (*Store) DeleteValues ¶
DeleteValues deletes all the values
func (*Store) ListSchemas ¶
ListSchemas gets a list of schemas
func (*Store) RetrieveSchema ¶
RetrieveSchema gets a schema
func (*Store) RetrieveValue ¶
RetrieveValue retrieves a single designated value
func (*Store) RetrieveValues ¶
RetrieveValues gets all the values from the backend in a map
func (*Store) StoreDefaultValues ¶
StoreDefaultValues stores the default values for an app
func (*Store) StoreSchema ¶
StoreSchema stores or updates a schema and makes sure that the schema is valid before storage.
func (*Store) StoreValue ¶
StoreValue stores a single value