core

package
v0.0.0-...-532184d Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UseDataStore

func UseDataStore(ds datalayer.DataStore) configFunc

Types

type Config

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

func New

func New(configFuncs ...configFunc) (*Config, error)

func (*Config) CreateCollection

func (cf *Config) CreateCollection(ctx context.Context, name string, schema, metadata map[string]interface{}) error

func (*Config) GetCollections

func (cf *Config) GetCollections(ctx context.Context) (collections []datalayer.CollectionVM, err error)

func (*Config) GetItem

func (cf *Config) GetItem(ctx context.Context, collectionName, itemID string) (item map[string]interface{}, err error)

func (*Config) GetItems

func (cf *Config) GetItems(ctx context.Context, collectionName string, queryMeta datalayer.QueryMeta) (items []map[string]interface{}, respInfo datalayer.ItemsResponseInfo, err error)

func (*Config) GetSchema

func (cf *Config) GetSchema(ctx context.Context, collectionName string) (schema map[string]interface{}, err error)

func (*Config) SaveItem

func (cf *Config) SaveItem(ctx context.Context, collectionName string, item map[string]interface{}) error

type Manager

type Manager interface {
	CreateCollection(ctx context.Context, name string, schema, metadata map[string]interface{}) error
	GetCollections(ctx context.Context) (collections []datalayer.CollectionVM, err error)
	GetSchema(ctx context.Context, collectionName string) (map[string]interface{}, error)
	SaveItem(ctx context.Context, collectionName string, item map[string]interface{}) error
	GetItem(ctx context.Context, collectionName, itemID string) (item map[string]interface{}, err error)
	GetItems(ctx context.Context, collectionName string, queryMeta datalayer.QueryMeta) (items []map[string]interface{}, respInfo datalayer.ItemsResponseInfo, err error)
}

type ValidationErrors

type ValidationErrors []gojsonschema.ResultError

func (ValidationErrors) Error

func (v ValidationErrors) Error() string

func (ValidationErrors) ValidationErrors

func (v ValidationErrors) ValidationErrors() []gojsonschema.ResultError

Jump to

Keyboard shortcuts

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