Documentation ¶
Index ¶
- func All(source string) (map[string]map[string]interface{}, error)
- func Count(source string, search map[string]interface{}) (int64, error)
- func Delete(source string, entityId string) error
- func Find(source string, search map[string]interface{}) (map[string]map[string]interface{}, error)
- func FindAndDelete(source string, search map[string]interface{}) error
- func FindOne(source string, search map[string]interface{}) (string, map[string]interface{}, error)
- func Register(dataSource data_source.DataSource)
- func Save(source string, entityId string, entity map[string]interface{}) error
- func Start()
- func StartDataSources()
- func Stop() error
- type InvalidDataSourceError
- type MetadataTypeRequiredError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func All ¶
All loads all entities from a data source. It will call `ecs.Create` passing the map returned by the data source for each entity, and return a map of entities keyed by their ids.
func Find ¶
Find returns a list of entities from executing a search against a provided map. It returns a list of entities as a map keyed by their ids. It passes each entity found through `ecs.create`, If the entity does not have valid metadata, or that metadata does not define the entity type, an error is thrown. If the data source does not exist, an error will be thrown.
func FindAndDelete ¶
func Register ¶
func Register(dataSource data_source.DataSource)
func Save ¶
Save saves data to a data source for a given entity. If the entity does not have a valid metadata field an error will be thrown. If the data source does not exist, an error will be thrown. If the metadata field does not have a type set, an error will be thrown. If the entity exists in the data source, it will be overwritten.
func StartDataSources ¶
func StartDataSources()
Types ¶
type InvalidDataSourceError ¶
type InvalidDataSourceError struct {
Source string
}
func (InvalidDataSourceError) Error ¶
func (e InvalidDataSourceError) Error() string
type MetadataTypeRequiredError ¶
type MetadataTypeRequiredError struct {
ID string
}
func (MetadataTypeRequiredError) Error ¶
func (e MetadataTypeRequiredError) Error() string