datastore

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2019 License: NCSA Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidData = errors.New("Invalid data unmarshalled")
View Source
var ErrInvalidDefinition = errors.New("DataStore definition is invalid")
View Source
var ErrTypeMismatch = errors.New("Type mismatch in data and definition")

Functions

This section is empty.

Types

type DataStore

type DataStore struct {
	Definition DataStoreDefinition
	Data       map[string]interface{}
}

func NewDataStore

func NewDataStore(definition DataStoreDefinition) DataStore

func (*DataStore) GetBSON

func (datastore *DataStore) GetBSON() (interface{}, error)

func (*DataStore) MarshalJSON

func (datastore *DataStore) MarshalJSON() ([]byte, error)

func (*DataStore) SetBSON

func (datastore *DataStore) SetBSON(raw bson.Raw) error

func (*DataStore) UnmarshalJSON

func (datastore *DataStore) UnmarshalJSON(b []byte) error

func (*DataStore) Validate

func (datastore *DataStore) Validate() error

type DataStoreDefinition

type DataStoreDefinition struct {
	Name        string                `json:"name"`
	Type        string                `json:"type"`
	Validations string                `json:"validations"`
	Fields      []DataStoreDefinition `json:"fields"`
}

Jump to

Keyboard shortcuts

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