Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aspect ¶
type Aspect struct { Name string // contains filtered or unexported fields }
Aspect is a group of access patterns under a directory.
type DataBag ¶
type DataBag interface { Get(path string, value interface{}) error Set(path string, value interface{}) error Data() ([]byte, error) }
DataBag controls access to the aspect data storage.
type Directory ¶
type Directory struct { Name string // contains filtered or unexported fields }
Directory holds a series of related aspects.
type JSONDataBag ¶
type JSONDataBag map[string]json.RawMessage
JSONDataBag is a simple DataBag implementation that keeps JSON in-memory.
func NewJSONDataBag ¶
func NewJSONDataBag() JSONDataBag
NewJSONDataBag returns a DataBag implementation that stores data in JSON. The top-level of the JSON structure is always a map.
func (JSONDataBag) Data ¶
func (s JSONDataBag) Data() ([]byte, error)
Data returns all of the bag's data encoded in JSON.
func (JSONDataBag) Get ¶
func (s JSONDataBag) Get(path string, value interface{}) error
Get takes a path and a pointer to a variable into which the value referenced by the path is written. The path can be dotted. For each dot a JSON object is expected to exist (e.g., "a.b" is mapped to {"a": {"b": <value>}}).
func (JSONDataBag) Set ¶
func (s JSONDataBag) Set(path string, value interface{}) error
Set takes a path to which the value will be written. The path can be dotted, in which case, a nested JSON object is created for each sub-key found after a dot.
type JSONSchema ¶
type JSONSchema struct{}
JSONSchema is the Schema implementation corresponding to JSONDataBag and it's able to validate its data.
func NewJSONSchema ¶
func NewJSONSchema() *JSONSchema
NewJSONSchema returns a Schema able to validate a JSONDataBag's data.
func (*JSONSchema) Validate ¶
func (s *JSONSchema) Validate(jsonData []byte) error
Validate validates that the specified data can be encoded into JSON.
type NotFoundError ¶
type NotFoundError struct {
Message string
}
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
func (*NotFoundError) Is ¶
func (e *NotFoundError) Is(err error) bool