backends

package
v3.4.7-0...-d5663eb Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: LGPL-2.1 Imports: 54 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatYAML SerializationFormat = `yaml`
	FormatJSON                     = `json`
	FormatCSV                      = `csv`
)
View Source
const ClientUserAgent = `pivot/` + util.Version
View Source
const DefaultFilesystemRecordSubdirectory = `data`

Variables

View Source
var AutopingTimeout = 5 * time.Second
View Source
var BleveBatchFlushCount = 1
View Source
var BleveBatchFlushInterval = 10 * time.Second
View Source
var BleveIdentityField = `_id`
View Source
var DefaultAmazonRegion = `us-east-1`
View Source
var DefaultAutoregister = false
View Source
var DefaultCompoundJoiner = `:`
View Source
var DefaultConnectTimeout = 10 * time.Second
View Source
var DefaultSharedCredentialsFile = `~/.aws/credentials`
View Source
var DefaultSharedCredentialsProfile = `default`
View Source
var DyanmoListFieldsLimit = 8192
View Source
var ElasticsearchAnalyzers = map[string]interface{}{
	`pivot_case_insensitive`: map[string]interface{}{
		`tokenizer`: `keyword`,
		`filter`:    []string{`lowercase`},
	},
}
View Source
var ElasticsearchBatchFlushCount = 1
View Source
var ElasticsearchBatchFlushInterval = 10 * time.Second
View Source
var ElasticsearchConnectTimeout = 3 * time.Second
View Source
var ElasticsearchDefaultCompositeJoiner = `--`
View Source
var ElasticsearchDefaultHost = `localhost:9200`
View Source
var ElasticsearchDefaultRefresh = `false`
View Source
var ElasticsearchDefaultReplicas = 2
View Source
var ElasticsearchDefaultScheme = `http`
View Source
var ElasticsearchDefaultShards = 3
View Source
var ElasticsearchDefaultType = `_doc`
View Source
var ElasticsearchDocumentType = `_doc`
View Source
var ElasticsearchIdentityField = `_id`
View Source
var ElasticsearchNormalizers = map[string]interface{}{
	`pivot_normalize_string`: map[string]interface{}{
		`type`:   `custom`,
		`filter`: []string{`lowercase`},
	},
}
View Source
var ElasticsearchRequestTimeout = 30 * time.Second
View Source
var ElasticsearchResponseHeaderTimeout = 10 * time.Second
View Source
var ElasticsearchScrollLifetime = `1m`
View Source
var ElasticsearchTLSTimeout = 10 * time.Second
View Source
var FilesystemKeyJoiner = `--`
View Source
var FilesystemRecordCacheSize = 1024
View Source
var IndexerPageSize int = 100
View Source
var IndexerResultsStop = fmt.Errorf(`stop indexer results`)
View Source
var InitialPingTimeout = time.Duration(10) * time.Second
View Source
var MaxFacetCardinality int = 10000
View Source
var MongoIdentityField = `_id`
View Source
var NotImplementedError = fmt.Errorf("Not Implemented")
View Source
var RecordCacheEnabled = false
View Source
var RedisDefaultAddress = `localhost:6379`
View Source
var RedisDefaultProtocol = `tcp`
View Source
var SqlArrayFieldHintLength = 131069
View Source
var SqlObjectFieldHintLength = 131071
View Source
var WriteLockFormat = `%s.lock`

Functions

func DefaultQueryImplementation

func DefaultQueryImplementation(indexer Indexer, collection *dal.Collection, f *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)

func PopulateRecordSetPageDetails

func PopulateRecordSetPageDetails(recordset *dal.RecordSet, f *filter.Filter, page IndexPage)

func PopulateRelationships

func PopulateRelationships(backend Backend, parent *dal.Collection, record *dal.Record, prepId func(interface{}) interface{}, requestedFields ...string) error

func RegisterBackend

func RegisterBackend(name string, fn BackendFunc)

Register a new or replacement backend for the given connection string scheme. For example, registering backend "foo" will allow Pivot to handle "foo://" connection strings.

func RegisterSqlInitFunc

func RegisterSqlInitFunc(scheme string, fn SqlInitFunc)

func RegisterSqlPreInitFunc

func RegisterSqlPreInitFunc(scheme string, fn SqlPreInitFunc)

func ResolveDeferredRecords

func ResolveDeferredRecords(cache map[string]interface{}, records ...*dal.Record) error

Types

type Aggregator

type Aggregator interface {
	AggregatorConnectionString() *dal.ConnectionString
	AggregatorInitialize(Backend) error
	Sum(collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)
	Count(collection *dal.Collection, f ...*filter.Filter) (uint64, error)
	Minimum(collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)
	Maximum(collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)
	Average(collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)
	GroupBy(collection *dal.Collection, fields []string, aggregates []filter.Aggregate, f ...*filter.Filter) (*dal.RecordSet, error)
}

type Backend

type Backend interface {
	Initialize() error
	SetIndexer(dal.ConnectionString) error
	RegisterCollection(*dal.Collection)
	GetConnectionString() *dal.ConnectionString
	Exists(collection string, id interface{}) bool
	Retrieve(collection string, id interface{}, fields ...string) (*dal.Record, error)
	Insert(collection string, records *dal.RecordSet) error
	Update(collection string, records *dal.RecordSet, target ...string) error
	Delete(collection string, ids ...interface{}) error
	CreateCollection(definition *dal.Collection) error
	DeleteCollection(collection string) error
	ListCollections() ([]string, error)
	GetCollection(collection string) (*dal.Collection, error)
	WithSearch(collection *dal.Collection, filters ...*filter.Filter) Indexer
	WithAggregator(collection *dal.Collection) Aggregator
	Flush() error
	Ping(time.Duration) error
	String() string
	Supports(feature ...BackendFeature) bool
}

func MakeBackend

func MakeBackend(connection dal.ConnectionString) (Backend, error)

Instantiate the appropriate Backend for the given connection string.

func NewDynamoBackend

func NewDynamoBackend(connection dal.ConnectionString) Backend

func NewElasticsearchBackend

func NewElasticsearchBackend(connection dal.ConnectionString) Backend

func NewFileBackend

func NewFileBackend(connection dal.ConnectionString) Backend

func NewFilesystemBackend

func NewFilesystemBackend(connection dal.ConnectionString) Backend

func NewMongoBackend

func NewMongoBackend(connection dal.ConnectionString) Backend

func NewRedisBackend

func NewRedisBackend(connection dal.ConnectionString) Backend

func NewSqlBackend

func NewSqlBackend(connection dal.ConnectionString) Backend

type BackendFeature

type BackendFeature int
const (
	PartialSearch BackendFeature = iota
	CompositeKeys
	Constraints
)

type BackendFunc

type BackendFunc func(dal.ConnectionString) Backend

type BleveIndexer

type BleveIndexer struct {
	Indexer
	// contains filtered or unexported fields
}

func NewBleveIndexer

func NewBleveIndexer(connection dal.ConnectionString) *BleveIndexer

func (*BleveIndexer) DeleteQuery

func (self *BleveIndexer) DeleteQuery(collection *dal.Collection, f *filter.Filter) error

func (*BleveIndexer) FlushIndex

func (self *BleveIndexer) FlushIndex() error

func (*BleveIndexer) GetBackend

func (self *BleveIndexer) GetBackend() Backend

func (*BleveIndexer) Index

func (self *BleveIndexer) Index(collection *dal.Collection, records *dal.RecordSet) error

func (*BleveIndexer) IndexConnectionString

func (self *BleveIndexer) IndexConnectionString() *dal.ConnectionString

func (*BleveIndexer) IndexExists

func (self *BleveIndexer) IndexExists(collection *dal.Collection, id interface{}) bool

func (*BleveIndexer) IndexInitialize

func (self *BleveIndexer) IndexInitialize(parent Backend) error

func (*BleveIndexer) IndexRemove

func (self *BleveIndexer) IndexRemove(collection *dal.Collection, ids []interface{}) error

func (*BleveIndexer) IndexRetrieve

func (self *BleveIndexer) IndexRetrieve(collection *dal.Collection, id interface{}) (*dal.Record, error)

func (*BleveIndexer) ListValues

func (self *BleveIndexer) ListValues(collection *dal.Collection, fields []string, f *filter.Filter) (map[string][]interface{}, error)

func (*BleveIndexer) Query

func (self *BleveIndexer) Query(collection *dal.Collection, f *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)

func (*BleveIndexer) QueryFunc

func (self *BleveIndexer) QueryFunc(collection *dal.Collection, f *filter.Filter, resultFn IndexResultFunc) error

type CachingBackend

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

func NewCachingBackend

func NewCachingBackend(parent Backend) *CachingBackend

func (*CachingBackend) CreateCollection

func (self *CachingBackend) CreateCollection(definition *dal.Collection) error

func (*CachingBackend) Delete

func (self *CachingBackend) Delete(collection string, ids ...interface{}) error

func (*CachingBackend) DeleteCollection

func (self *CachingBackend) DeleteCollection(collection string) error

func (*CachingBackend) Exists

func (self *CachingBackend) Exists(collection string, id interface{}) bool

passthrough the remaining functions to fulfill the Backend interface -------------------------------------------------------------------------------------------------

func (*CachingBackend) Flush

func (self *CachingBackend) Flush() error

func (*CachingBackend) GetCollection

func (self *CachingBackend) GetCollection(collection string) (*dal.Collection, error)

func (*CachingBackend) GetConnectionString

func (self *CachingBackend) GetConnectionString() *dal.ConnectionString

func (*CachingBackend) Initialize

func (self *CachingBackend) Initialize() error

func (*CachingBackend) Insert

func (self *CachingBackend) Insert(collection string, records *dal.RecordSet) error

func (*CachingBackend) ListCollections

func (self *CachingBackend) ListCollections() ([]string, error)

func (*CachingBackend) Ping

func (self *CachingBackend) Ping(d time.Duration) error

func (*CachingBackend) RegisterCollection

func (self *CachingBackend) RegisterCollection(c *dal.Collection)

func (*CachingBackend) ResetCache

func (self *CachingBackend) ResetCache()

func (*CachingBackend) Retrieve

func (self *CachingBackend) Retrieve(collection string, id interface{}, fields ...string) (*dal.Record, error)

func (*CachingBackend) SetIndexer

func (self *CachingBackend) SetIndexer(cs dal.ConnectionString) error

func (*CachingBackend) String

func (self *CachingBackend) String() string

func (*CachingBackend) Supports

func (self *CachingBackend) Supports(feature ...BackendFeature) bool

func (*CachingBackend) Update

func (self *CachingBackend) Update(collection string, records *dal.RecordSet, target ...string) error

func (*CachingBackend) WithAggregator

func (self *CachingBackend) WithAggregator(collection *dal.Collection) Aggregator

func (*CachingBackend) WithSearch

func (self *CachingBackend) WithSearch(collection *dal.Collection, filters ...*filter.Filter) Indexer

type ConnectOptions

type ConnectOptions struct {
	Indexer               string   `json:"indexer"`
	AdditionalIndexers    []string `json:"additional_indexers"`
	SkipInitialize        bool     `json:"skip_initialize"`
	AutocreateCollections bool     `json:"autocreate_collections"`
}

type DeferredRecord

type DeferredRecord struct {
	Original          interface{}
	Backend           Backend
	IdentityFieldName string
	CollectionName    string
	ID                interface{}
	Keys              []string
}

func (*DeferredRecord) GroupKey

func (self *DeferredRecord) GroupKey(id ...interface{}) string

func (*DeferredRecord) String

func (self *DeferredRecord) String() string

type DynamoBackend

type DynamoBackend struct {
	Backend
	Indexer
	// contains filtered or unexported fields
}

func (*DynamoBackend) CreateCollection

func (self *DynamoBackend) CreateCollection(definition *dal.Collection) error

func (*DynamoBackend) Delete

func (self *DynamoBackend) Delete(name string, ids ...interface{}) error

func (*DynamoBackend) DeleteCollection

func (self *DynamoBackend) DeleteCollection(name string) error

func (*DynamoBackend) DeleteQuery

func (self *DynamoBackend) DeleteQuery(collection *dal.Collection, flt *filter.Filter) error

func (*DynamoBackend) Exists

func (self *DynamoBackend) Exists(name string, id interface{}) bool

func (*DynamoBackend) Flush

func (self *DynamoBackend) Flush() error

func (*DynamoBackend) FlushIndex

func (self *DynamoBackend) FlushIndex() error

func (*DynamoBackend) GetBackend

func (self *DynamoBackend) GetBackend() Backend

func (*DynamoBackend) GetCollection

func (self *DynamoBackend) GetCollection(name string) (*dal.Collection, error)

func (*DynamoBackend) GetConnectionString

func (self *DynamoBackend) GetConnectionString() *dal.ConnectionString

func (*DynamoBackend) Index

func (self *DynamoBackend) Index(collection *dal.Collection, records *dal.RecordSet) error

func (*DynamoBackend) IndexConnectionString

func (self *DynamoBackend) IndexConnectionString() *dal.ConnectionString

func (*DynamoBackend) IndexExists

func (self *DynamoBackend) IndexExists(collection *dal.Collection, id interface{}) bool

func (*DynamoBackend) IndexInitialize

func (self *DynamoBackend) IndexInitialize(Backend) error

func (*DynamoBackend) IndexRemove

func (self *DynamoBackend) IndexRemove(collection *dal.Collection, ids []interface{}) error

func (*DynamoBackend) IndexRetrieve

func (self *DynamoBackend) IndexRetrieve(collection *dal.Collection, id interface{}) (*dal.Record, error)

func (*DynamoBackend) Initialize

func (self *DynamoBackend) Initialize() error

func (*DynamoBackend) Insert

func (self *DynamoBackend) Insert(name string, records *dal.RecordSet) error

func (*DynamoBackend) ListCollections

func (self *DynamoBackend) ListCollections() ([]string, error)

func (*DynamoBackend) ListValues

func (self *DynamoBackend) ListValues(collection *dal.Collection, fields []string, flt *filter.Filter) (map[string][]interface{}, error)

func (*DynamoBackend) Ping

func (self *DynamoBackend) Ping(timeout time.Duration) error

func (*DynamoBackend) Query

func (self *DynamoBackend) Query(collection *dal.Collection, f *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)

func (*DynamoBackend) QueryFunc

func (self *DynamoBackend) QueryFunc(collection *dal.Collection, flt *filter.Filter, resultFn IndexResultFunc) error

func (*DynamoBackend) RegisterCollection

func (self *DynamoBackend) RegisterCollection(definition *dal.Collection)

func (*DynamoBackend) Retrieve

func (self *DynamoBackend) Retrieve(name string, id interface{}, fields ...string) (*dal.Record, error)

func (*DynamoBackend) SetIndexer

func (self *DynamoBackend) SetIndexer(indexConnString dal.ConnectionString) error

func (*DynamoBackend) String

func (self *DynamoBackend) String() string

func (*DynamoBackend) Supports

func (self *DynamoBackend) Supports(features ...BackendFeature) bool

func (*DynamoBackend) Update

func (self *DynamoBackend) Update(name string, records *dal.RecordSet, target ...string) error

func (*DynamoBackend) WithAggregator

func (self *DynamoBackend) WithAggregator(collection *dal.Collection) Aggregator

func (*DynamoBackend) WithSearch

func (self *DynamoBackend) WithSearch(collection *dal.Collection, filters ...*filter.Filter) Indexer

type ElasticsearchBackend

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

func (*ElasticsearchBackend) CreateCollection

func (self *ElasticsearchBackend) CreateCollection(definition *dal.Collection) error

func (*ElasticsearchBackend) Delete

func (self *ElasticsearchBackend) Delete(name string, ids ...interface{}) error

func (*ElasticsearchBackend) DeleteCollection

func (self *ElasticsearchBackend) DeleteCollection(name string) error

func (*ElasticsearchBackend) Exists

func (self *ElasticsearchBackend) Exists(name string, id interface{}) bool

func (*ElasticsearchBackend) Flush

func (self *ElasticsearchBackend) Flush() error

func (*ElasticsearchBackend) GetCollection

func (self *ElasticsearchBackend) GetCollection(name string) (*dal.Collection, error)

func (*ElasticsearchBackend) GetConnectionString

func (self *ElasticsearchBackend) GetConnectionString() *dal.ConnectionString

func (*ElasticsearchBackend) Initialize

func (self *ElasticsearchBackend) Initialize() error

func (*ElasticsearchBackend) Insert

func (self *ElasticsearchBackend) Insert(name string, records *dal.RecordSet) error

func (*ElasticsearchBackend) ListCollections

func (self *ElasticsearchBackend) ListCollections() ([]string, error)

func (*ElasticsearchBackend) Ping

func (self *ElasticsearchBackend) Ping(timeout time.Duration) error

func (*ElasticsearchBackend) RegisterCollection

func (self *ElasticsearchBackend) RegisterCollection(definition *dal.Collection)

func (*ElasticsearchBackend) Retrieve

func (self *ElasticsearchBackend) Retrieve(name string, id interface{}, fields ...string) (*dal.Record, error)

func (*ElasticsearchBackend) SetIndexer

func (self *ElasticsearchBackend) SetIndexer(indexConnString dal.ConnectionString) error

func (*ElasticsearchBackend) String

func (self *ElasticsearchBackend) String() string

func (*ElasticsearchBackend) Supports

func (self *ElasticsearchBackend) Supports(features ...BackendFeature) bool

func (*ElasticsearchBackend) Update

func (self *ElasticsearchBackend) Update(name string, records *dal.RecordSet, target ...string) error

func (*ElasticsearchBackend) WithAggregator

func (self *ElasticsearchBackend) WithAggregator(collection *dal.Collection) Aggregator

func (*ElasticsearchBackend) WithSearch

func (self *ElasticsearchBackend) WithSearch(collection *dal.Collection, filters ...*filter.Filter) Indexer

type ElasticsearchIndexer

type ElasticsearchIndexer struct {
	Indexer
	// contains filtered or unexported fields
}

func NewElasticsearchIndexer

func NewElasticsearchIndexer(connection dal.ConnectionString) *ElasticsearchIndexer

func (*ElasticsearchIndexer) AggregatorConnectionString

func (self *ElasticsearchIndexer) AggregatorConnectionString() *dal.ConnectionString

func (*ElasticsearchIndexer) AggregatorInitialize

func (self *ElasticsearchIndexer) AggregatorInitialize(parent Backend) error

func (*ElasticsearchIndexer) Average

func (self *ElasticsearchIndexer) Average(collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)

func (*ElasticsearchIndexer) Count

func (self *ElasticsearchIndexer) Count(collection *dal.Collection, flt ...*filter.Filter) (uint64, error)

func (*ElasticsearchIndexer) DeleteQuery

func (self *ElasticsearchIndexer) DeleteQuery(collection *dal.Collection, f *filter.Filter) error

func (*ElasticsearchIndexer) FlushIndex

func (self *ElasticsearchIndexer) FlushIndex() error

func (*ElasticsearchIndexer) GetBackend

func (self *ElasticsearchIndexer) GetBackend() Backend

func (*ElasticsearchIndexer) GroupBy

func (self *ElasticsearchIndexer) GroupBy(collection *dal.Collection, groupBy []string, aggregates []filter.Aggregate, flt ...*filter.Filter) (*dal.RecordSet, error)

func (*ElasticsearchIndexer) Index

func (self *ElasticsearchIndexer) Index(collection *dal.Collection, records *dal.RecordSet) error

func (*ElasticsearchIndexer) IndexConnectionString

func (self *ElasticsearchIndexer) IndexConnectionString() *dal.ConnectionString

func (*ElasticsearchIndexer) IndexExists

func (self *ElasticsearchIndexer) IndexExists(collection *dal.Collection, id interface{}) bool

func (*ElasticsearchIndexer) IndexInitialize

func (self *ElasticsearchIndexer) IndexInitialize(parent Backend) error

func (*ElasticsearchIndexer) IndexRemove

func (self *ElasticsearchIndexer) IndexRemove(collection *dal.Collection, ids []interface{}) error

func (*ElasticsearchIndexer) IndexRetrieve

func (self *ElasticsearchIndexer) IndexRetrieve(collection *dal.Collection, id interface{}) (*dal.Record, error)

func (*ElasticsearchIndexer) ListValues

func (self *ElasticsearchIndexer) ListValues(collection *dal.Collection, fields []string, f *filter.Filter) (map[string][]interface{}, error)

func (*ElasticsearchIndexer) Maximum

func (self *ElasticsearchIndexer) Maximum(collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)

func (*ElasticsearchIndexer) Minimum

func (self *ElasticsearchIndexer) Minimum(collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)

func (*ElasticsearchIndexer) Query

func (self *ElasticsearchIndexer) Query(collection *dal.Collection, f *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)

func (*ElasticsearchIndexer) QueryFunc

func (self *ElasticsearchIndexer) QueryFunc(collection *dal.Collection, f *filter.Filter, resultFn IndexResultFunc) error

func (*ElasticsearchIndexer) Sum

func (self *ElasticsearchIndexer) Sum(collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)

type EmbeddedRecordBackend

type EmbeddedRecordBackend struct {
	SkipKeys []string
	// contains filtered or unexported fields
}

func NewEmbeddedRecordBackend

func NewEmbeddedRecordBackend(parent Backend, skipKeys ...string) *EmbeddedRecordBackend

func (*EmbeddedRecordBackend) CreateCollection

func (self *EmbeddedRecordBackend) CreateCollection(definition *dal.Collection) error

func (*EmbeddedRecordBackend) Delete

func (self *EmbeddedRecordBackend) Delete(collection string, ids ...interface{}) error

func (*EmbeddedRecordBackend) DeleteCollection

func (self *EmbeddedRecordBackend) DeleteCollection(collection string) error

func (*EmbeddedRecordBackend) DeleteQuery

func (self *EmbeddedRecordBackend) DeleteQuery(collection *dal.Collection, f *filter.Filter) error

func (*EmbeddedRecordBackend) EmbedRelationships

func (self *EmbeddedRecordBackend) EmbedRelationships(collection *dal.Collection, record *dal.Record, fields ...string) (*dal.Record, error)

func (*EmbeddedRecordBackend) Exists

func (self *EmbeddedRecordBackend) Exists(collection string, id interface{}) bool

passthrough the remaining functions to fulfill the Backend interface -------------------------------------------------------------------------------------------------

func (*EmbeddedRecordBackend) Flush

func (self *EmbeddedRecordBackend) Flush() error

func (*EmbeddedRecordBackend) FlushIndex

func (self *EmbeddedRecordBackend) FlushIndex() error

func (*EmbeddedRecordBackend) GetBackend

func (self *EmbeddedRecordBackend) GetBackend() Backend

fulfill the Indexer interface -------------------------------------------------------------------------------------------------

func (*EmbeddedRecordBackend) GetCollection

func (self *EmbeddedRecordBackend) GetCollection(collection string) (*dal.Collection, error)

func (*EmbeddedRecordBackend) GetConnectionString

func (self *EmbeddedRecordBackend) GetConnectionString() *dal.ConnectionString

func (*EmbeddedRecordBackend) Index

func (self *EmbeddedRecordBackend) Index(collection *dal.Collection, records *dal.RecordSet) error

func (*EmbeddedRecordBackend) IndexConnectionString

func (self *EmbeddedRecordBackend) IndexConnectionString() *dal.ConnectionString

func (*EmbeddedRecordBackend) IndexExists

func (self *EmbeddedRecordBackend) IndexExists(collection *dal.Collection, id interface{}) bool

func (*EmbeddedRecordBackend) IndexInitialize

func (self *EmbeddedRecordBackend) IndexInitialize(b Backend) error

func (*EmbeddedRecordBackend) IndexRemove

func (self *EmbeddedRecordBackend) IndexRemove(collection *dal.Collection, ids []interface{}) error

func (*EmbeddedRecordBackend) IndexRetrieve

func (self *EmbeddedRecordBackend) IndexRetrieve(collection *dal.Collection, id interface{}) (*dal.Record, error)

func (*EmbeddedRecordBackend) Initialize

func (self *EmbeddedRecordBackend) Initialize() error

func (*EmbeddedRecordBackend) Insert

func (self *EmbeddedRecordBackend) Insert(collection string, records *dal.RecordSet) error

func (*EmbeddedRecordBackend) ListCollections

func (self *EmbeddedRecordBackend) ListCollections() ([]string, error)

func (*EmbeddedRecordBackend) ListValues

func (self *EmbeddedRecordBackend) ListValues(collection *dal.Collection, fields []string, filter *filter.Filter) (map[string][]interface{}, error)

func (*EmbeddedRecordBackend) Migrate

func (self *EmbeddedRecordBackend) Migrate() error

func (*EmbeddedRecordBackend) Ping

func (self *EmbeddedRecordBackend) Ping(d time.Duration) error

func (*EmbeddedRecordBackend) Query

func (self *EmbeddedRecordBackend) Query(collection *dal.Collection, filter *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)

func (*EmbeddedRecordBackend) QueryFunc

func (self *EmbeddedRecordBackend) QueryFunc(collection *dal.Collection, filter *filter.Filter, resultFn IndexResultFunc) error

func (*EmbeddedRecordBackend) RegisterCollection

func (self *EmbeddedRecordBackend) RegisterCollection(c *dal.Collection)

func (*EmbeddedRecordBackend) Retrieve

func (self *EmbeddedRecordBackend) Retrieve(name string, id interface{}, fields ...string) (*dal.Record, error)

func (*EmbeddedRecordBackend) SetIndexer

func (self *EmbeddedRecordBackend) SetIndexer(cs dal.ConnectionString) error

func (*EmbeddedRecordBackend) String

func (self *EmbeddedRecordBackend) String() string

func (*EmbeddedRecordBackend) Supports

func (self *EmbeddedRecordBackend) Supports(feature ...BackendFeature) bool

func (*EmbeddedRecordBackend) Update

func (self *EmbeddedRecordBackend) Update(collection string, records *dal.RecordSet, target ...string) error

func (*EmbeddedRecordBackend) WithAggregator

func (self *EmbeddedRecordBackend) WithAggregator(collection *dal.Collection) Aggregator

func (*EmbeddedRecordBackend) WithSearch

func (self *EmbeddedRecordBackend) WithSearch(collection *dal.Collection, filters ...*filter.Filter) Indexer

type FileBackend

type FileBackend struct {
	Backend
	Indexer
	// contains filtered or unexported fields
}

func (*FileBackend) CreateCollection

func (self *FileBackend) CreateCollection(definition *dal.Collection) error

func (*FileBackend) Delete

func (self *FileBackend) Delete(collection string, ids ...interface{}) error

func (*FileBackend) DeleteCollection

func (self *FileBackend) DeleteCollection(collection string) error

func (*FileBackend) Exists

func (self *FileBackend) Exists(name string, id interface{}) bool

func (*FileBackend) Flush

func (self *FileBackend) Flush() error

func (*FileBackend) GetCollection

func (self *FileBackend) GetCollection(collection string) (*dal.Collection, error)

func (*FileBackend) GetConnectionString

func (self *FileBackend) GetConnectionString() *dal.ConnectionString

func (*FileBackend) Initialize

func (self *FileBackend) Initialize() error

func (*FileBackend) Insert

func (self *FileBackend) Insert(collection string, records *dal.RecordSet) error

func (*FileBackend) ListCollections

func (self *FileBackend) ListCollections() ([]string, error)

func (*FileBackend) Ping

func (self *FileBackend) Ping(_ time.Duration) error

func (*FileBackend) RegisterCollection

func (self *FileBackend) RegisterCollection(collection *dal.Collection)

func (*FileBackend) Retrieve

func (self *FileBackend) Retrieve(name string, id interface{}, fields ...string) (*dal.Record, error)

func (*FileBackend) SetIndexer

func (self *FileBackend) SetIndexer(dal.ConnectionString) error

func (*FileBackend) String

func (self *FileBackend) String() string

func (*FileBackend) Supports

func (self *FileBackend) Supports(features ...BackendFeature) bool

func (*FileBackend) Update

func (self *FileBackend) Update(collection string, records *dal.RecordSet, target ...string) error

func (*FileBackend) WithAggregator

func (self *FileBackend) WithAggregator(collection *dal.Collection) Aggregator

func (*FileBackend) WithSearch

func (self *FileBackend) WithSearch(collection *dal.Collection, filters ...*filter.Filter) Indexer

type FilesystemBackend

type FilesystemBackend struct {
	Backend
	Indexer
	// contains filtered or unexported fields
}

func (*FilesystemBackend) CreateCollection

func (self *FilesystemBackend) CreateCollection(definition *dal.Collection) error

func (*FilesystemBackend) Delete

func (self *FilesystemBackend) Delete(name string, ids ...interface{}) error

func (*FilesystemBackend) DeleteCollection

func (self *FilesystemBackend) DeleteCollection(name string) error

func (*FilesystemBackend) DeleteQuery

func (self *FilesystemBackend) DeleteQuery(collection *dal.Collection, f *filter.Filter) error

func (*FilesystemBackend) Exists

func (self *FilesystemBackend) Exists(name string, id interface{}) bool

func (*FilesystemBackend) Flush

func (self *FilesystemBackend) Flush() error

func (*FilesystemBackend) FlushIndex

func (self *FilesystemBackend) FlushIndex() error

func (*FilesystemBackend) GetBackend

func (self *FilesystemBackend) GetBackend() Backend

func (*FilesystemBackend) GetCollection

func (self *FilesystemBackend) GetCollection(name string) (*dal.Collection, error)

func (*FilesystemBackend) GetConnectionString

func (self *FilesystemBackend) GetConnectionString() *dal.ConnectionString

func (*FilesystemBackend) Index

func (self *FilesystemBackend) Index(collection *dal.Collection, records *dal.RecordSet) error

func (*FilesystemBackend) IndexConnectionString

func (self *FilesystemBackend) IndexConnectionString() *dal.ConnectionString

func (*FilesystemBackend) IndexExists

func (self *FilesystemBackend) IndexExists(collection *dal.Collection, id interface{}) bool

func (*FilesystemBackend) IndexInitialize

func (self *FilesystemBackend) IndexInitialize(_ Backend) error

func (*FilesystemBackend) IndexRemove

func (self *FilesystemBackend) IndexRemove(collection *dal.Collection, ids []interface{}) error

func (*FilesystemBackend) IndexRetrieve

func (self *FilesystemBackend) IndexRetrieve(collection *dal.Collection, id interface{}) (*dal.Record, error)

func (*FilesystemBackend) Initialize

func (self *FilesystemBackend) Initialize() error

func (*FilesystemBackend) Insert

func (self *FilesystemBackend) Insert(collectionName string, recordset *dal.RecordSet) error

func (*FilesystemBackend) ListCollections

func (self *FilesystemBackend) ListCollections() ([]string, error)

func (*FilesystemBackend) ListValues

func (self *FilesystemBackend) ListValues(collection *dal.Collection, fields []string, f *filter.Filter) (map[string][]interface{}, error)

func (*FilesystemBackend) Ping

func (self *FilesystemBackend) Ping(timeout time.Duration) error

func (*FilesystemBackend) Query

func (self *FilesystemBackend) Query(collection *dal.Collection, f *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)

func (*FilesystemBackend) QueryFunc

func (self *FilesystemBackend) QueryFunc(collection *dal.Collection, filter *filter.Filter, resultFn IndexResultFunc) error

func (*FilesystemBackend) RegisterCollection

func (self *FilesystemBackend) RegisterCollection(collection *dal.Collection)

func (*FilesystemBackend) Retrieve

func (self *FilesystemBackend) Retrieve(name string, id interface{}, fields ...string) (*dal.Record, error)

func (*FilesystemBackend) SetIndexer

func (self *FilesystemBackend) SetIndexer(indexConnString dal.ConnectionString) error

func (*FilesystemBackend) String

func (self *FilesystemBackend) String() string

func (*FilesystemBackend) Supports

func (self *FilesystemBackend) Supports(features ...BackendFeature) bool

func (*FilesystemBackend) Update

func (self *FilesystemBackend) Update(name string, recordset *dal.RecordSet, target ...string) error

func (*FilesystemBackend) WithAggregator

func (self *FilesystemBackend) WithAggregator(collection *dal.Collection) Aggregator

func (*FilesystemBackend) WithSearch

func (self *FilesystemBackend) WithSearch(collection *dal.Collection, filters ...*filter.Filter) Indexer

type IndexOperation

type IndexOperation int
const (
	RetrieveOperation IndexOperation = iota
	PersistOperation
	DeleteOperation
	InspectionOperation
)

type IndexPage

type IndexPage struct {
	Page         int
	TotalPages   int
	Limit        int
	Offset       int
	TotalResults int64
}

type IndexResultFunc

type IndexResultFunc func(record *dal.Record, err error, page IndexPage) error // {}

type IndexSelectionStrategy

type IndexSelectionStrategy int
const (
	Sequential IndexSelectionStrategy = iota
	All
	First
	AllExceptFirst
	Random
)

func (IndexSelectionStrategy) IsCompoundable

func (self IndexSelectionStrategy) IsCompoundable() bool

type Indexer

type Indexer interface {
	IndexConnectionString() *dal.ConnectionString
	IndexInitialize(Backend) error
	IndexExists(collection *dal.Collection, id interface{}) bool
	IndexRetrieve(collection *dal.Collection, id interface{}) (*dal.Record, error)
	IndexRemove(collection *dal.Collection, ids []interface{}) error
	Index(collection *dal.Collection, records *dal.RecordSet) error
	QueryFunc(collection *dal.Collection, filter *filter.Filter, resultFn IndexResultFunc) error
	Query(collection *dal.Collection, filter *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)
	ListValues(collection *dal.Collection, fields []string, filter *filter.Filter) (map[string][]interface{}, error)
	DeleteQuery(collection *dal.Collection, f *filter.Filter) error
	FlushIndex() error
	GetBackend() Backend
}

func MakeIndexer

func MakeIndexer(connection dal.ConnectionString) (Indexer, error)

type IndexerResult

type IndexerResult struct {
	Index   int
	Indexer Indexer
}

type IndexerResultFunc

type IndexerResultFunc func(indexer Indexer, current int, last int) error // {}

type Mapper

type Mapper interface {
	GetBackend() Backend
	GetCollection() *dal.Collection
	Migrate() error
	Drop() error
	Exists(id interface{}) bool
	Create(from interface{}) error
	Get(id interface{}, into interface{}) error
	Update(from interface{}) error
	CreateOrUpdate(id interface{}, from interface{}) error
	Delete(ids ...interface{}) error
	DeleteQuery(flt interface{}) error
	Find(flt interface{}, into interface{}) error
	FindFunc(flt interface{}, destZeroValue interface{}, resultFn ResultFunc) error
	All(into interface{}) error
	Each(destZeroValue interface{}, resultFn ResultFunc) error
	List(fields []string) (map[string][]interface{}, error)
	ListWithFilter(fields []string, flt interface{}) (map[string][]interface{}, error)
	Sum(field string, flt interface{}) (float64, error)
	Count(flt interface{}) (uint64, error)
	Minimum(field string, flt interface{}) (float64, error)
	Maximum(field string, flt interface{}) (float64, error)
	Average(field string, flt interface{}) (float64, error)
	GroupBy(fields []string, aggregates []filter.Aggregate, flt interface{}) (*dal.RecordSet, error)
}

type MetaIndex

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

func NewMetaIndex

func NewMetaIndex(leftIndexer Indexer, leftCollection *dal.Collection, leftField string, rightIndexer Indexer, rightCollection *dal.Collection, rightField string) *MetaIndex

func (*MetaIndex) DeleteQuery

func (self *MetaIndex) DeleteQuery(collection *dal.Collection, f *filter.Filter) error

func (*MetaIndex) FlushIndex

func (self *MetaIndex) FlushIndex() error

func (*MetaIndex) GetBackend

func (self *MetaIndex) GetBackend() Backend

func (*MetaIndex) Index

func (self *MetaIndex) Index(collection *dal.Collection, records *dal.RecordSet) error

func (*MetaIndex) IndexConnectionString

func (self *MetaIndex) IndexConnectionString() *dal.ConnectionString

func (*MetaIndex) IndexExists

func (self *MetaIndex) IndexExists(collection *dal.Collection, id interface{}) bool

func (*MetaIndex) IndexInitialize

func (self *MetaIndex) IndexInitialize(_ Backend) error

func (*MetaIndex) IndexRemove

func (self *MetaIndex) IndexRemove(collection *dal.Collection, ids []interface{}) error

func (*MetaIndex) IndexRetrieve

func (self *MetaIndex) IndexRetrieve(collection *dal.Collection, id interface{}) (*dal.Record, error)

func (*MetaIndex) ListValues

func (self *MetaIndex) ListValues(collection *dal.Collection, fields []string, filter *filter.Filter) (map[string][]interface{}, error)

func (*MetaIndex) Query

func (self *MetaIndex) Query(collection *dal.Collection, f *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)

func (*MetaIndex) QueryFunc

func (self *MetaIndex) QueryFunc(collection *dal.Collection, f *filter.Filter, resultFn IndexResultFunc) error

type MongoBackend

type MongoBackend struct {
	Backend
	Indexer
	// contains filtered or unexported fields
}

func (*MongoBackend) AggregatorConnectionString

func (self *MongoBackend) AggregatorConnectionString() *dal.ConnectionString

func (*MongoBackend) AggregatorInitialize

func (self *MongoBackend) AggregatorInitialize(parent Backend) error

func (*MongoBackend) Average

func (self *MongoBackend) Average(collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)

func (*MongoBackend) Count

func (self *MongoBackend) Count(collection *dal.Collection, flt ...*filter.Filter) (uint64, error)

func (*MongoBackend) CreateCollection

func (self *MongoBackend) CreateCollection(definition *dal.Collection) error

func (*MongoBackend) Delete

func (self *MongoBackend) Delete(name string, ids ...interface{}) error

func (*MongoBackend) DeleteCollection

func (self *MongoBackend) DeleteCollection(name string) error

func (*MongoBackend) DeleteQuery

func (self *MongoBackend) DeleteQuery(collection *dal.Collection, flt *filter.Filter) error

func (*MongoBackend) Exists

func (self *MongoBackend) Exists(name string, id interface{}) bool

func (*MongoBackend) Flush

func (self *MongoBackend) Flush() error

func (*MongoBackend) FlushIndex

func (self *MongoBackend) FlushIndex() error

func (*MongoBackend) GetBackend

func (self *MongoBackend) GetBackend() Backend

func (*MongoBackend) GetCollection

func (self *MongoBackend) GetCollection(name string) (*dal.Collection, error)

func (*MongoBackend) GetConnectionString

func (self *MongoBackend) GetConnectionString() *dal.ConnectionString

func (*MongoBackend) GroupBy

func (self *MongoBackend) GroupBy(collection *dal.Collection, groupBy []string, aggregates []filter.Aggregate, flt ...*filter.Filter) (*dal.RecordSet, error)

func (*MongoBackend) Index

func (self *MongoBackend) Index(collection *dal.Collection, records *dal.RecordSet) error

func (*MongoBackend) IndexConnectionString

func (self *MongoBackend) IndexConnectionString() *dal.ConnectionString

func (*MongoBackend) IndexExists

func (self *MongoBackend) IndexExists(collection *dal.Collection, id interface{}) bool

func (*MongoBackend) IndexInitialize

func (self *MongoBackend) IndexInitialize(Backend) error

func (*MongoBackend) IndexRemove

func (self *MongoBackend) IndexRemove(collection *dal.Collection, ids []interface{}) error

func (*MongoBackend) IndexRetrieve

func (self *MongoBackend) IndexRetrieve(collection *dal.Collection, id interface{}) (*dal.Record, error)

func (*MongoBackend) Initialize

func (self *MongoBackend) Initialize() error

func (*MongoBackend) Insert

func (self *MongoBackend) Insert(name string, records *dal.RecordSet) error

func (*MongoBackend) ListCollections

func (self *MongoBackend) ListCollections() ([]string, error)

func (*MongoBackend) ListValues

func (self *MongoBackend) ListValues(collection *dal.Collection, fields []string, flt *filter.Filter) (map[string][]interface{}, error)

func (*MongoBackend) Maximum

func (self *MongoBackend) Maximum(collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)

func (*MongoBackend) Minimum

func (self *MongoBackend) Minimum(collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)

func (*MongoBackend) Ping

func (self *MongoBackend) Ping(timeout time.Duration) error

func (*MongoBackend) Query

func (self *MongoBackend) Query(collection *dal.Collection, f *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)

func (*MongoBackend) QueryFunc

func (self *MongoBackend) QueryFunc(collection *dal.Collection, flt *filter.Filter, resultFn IndexResultFunc) error

func (*MongoBackend) RegisterCollection

func (self *MongoBackend) RegisterCollection(collection *dal.Collection)

func (*MongoBackend) Retrieve

func (self *MongoBackend) Retrieve(name string, id interface{}, fields ...string) (*dal.Record, error)

func (*MongoBackend) SetIndexer

func (self *MongoBackend) SetIndexer(indexConnString dal.ConnectionString) error

func (*MongoBackend) String

func (self *MongoBackend) String() string

func (*MongoBackend) Sum

func (self *MongoBackend) Sum(collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)

func (*MongoBackend) Supports

func (self *MongoBackend) Supports(features ...BackendFeature) bool

func (*MongoBackend) Update

func (self *MongoBackend) Update(name string, records *dal.RecordSet, target ...string) error

func (*MongoBackend) WithAggregator

func (self *MongoBackend) WithAggregator(collection *dal.Collection) Aggregator

func (*MongoBackend) WithSearch

func (self *MongoBackend) WithSearch(collection *dal.Collection, filters ...*filter.Filter) Indexer

type MultiIndex

type MultiIndex struct {
	RetrievalStrategy  IndexSelectionStrategy
	PersistStrategy    IndexSelectionStrategy
	DeleteStrategy     IndexSelectionStrategy
	InspectionStrategy IndexSelectionStrategy
	// contains filtered or unexported fields
}

func NewMultiIndex

func NewMultiIndex(connectionStrings ...string) *MultiIndex

func (*MultiIndex) AddIndexer

func (self *MultiIndex) AddIndexer(indexer Indexer) error

func (*MultiIndex) AddIndexerByConnectionString

func (self *MultiIndex) AddIndexerByConnectionString(cs string) error

func (*MultiIndex) DeleteQuery

func (self *MultiIndex) DeleteQuery(collection *dal.Collection, f *filter.Filter) error

func (*MultiIndex) EachSelectedIndex

func (self *MultiIndex) EachSelectedIndex(collection *dal.Collection, operation IndexOperation, resultFn IndexerResultFunc) error

func (*MultiIndex) FlushIndex

func (self *MultiIndex) FlushIndex() error

func (*MultiIndex) GetBackend

func (self *MultiIndex) GetBackend() Backend

func (*MultiIndex) Index

func (self *MultiIndex) Index(collection *dal.Collection, records *dal.RecordSet) error

func (*MultiIndex) IndexConnectionString

func (self *MultiIndex) IndexConnectionString() *dal.ConnectionString

func (*MultiIndex) IndexExists

func (self *MultiIndex) IndexExists(collection *dal.Collection, id interface{}) bool

func (*MultiIndex) IndexInitialize

func (self *MultiIndex) IndexInitialize(backend Backend) error

func (*MultiIndex) IndexRemove

func (self *MultiIndex) IndexRemove(collection *dal.Collection, ids []interface{}) error

func (*MultiIndex) IndexRetrieve

func (self *MultiIndex) IndexRetrieve(collection *dal.Collection, id interface{}) (*dal.Record, error)

func (*MultiIndex) ListValues

func (self *MultiIndex) ListValues(collection *dal.Collection, fields []string, filter *filter.Filter) (map[string][]interface{}, error)

func (*MultiIndex) Query

func (self *MultiIndex) Query(collection *dal.Collection, filter *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)

func (*MultiIndex) QueryFunc

func (self *MultiIndex) QueryFunc(collection *dal.Collection, filter *filter.Filter, resultFn IndexResultFunc) error

func (*MultiIndex) SelectIndex

func (self *MultiIndex) SelectIndex(collection *dal.Collection, operation IndexOperation, lastIndexer int) ([]IndexerResult, error)

type NullIndexer

type NullIndexer struct {
}

func (*NullIndexer) DeleteQuery

func (self *NullIndexer) DeleteQuery(collection *dal.Collection, f filter.Filter) error

func (*NullIndexer) FlushIndex

func (self *NullIndexer) FlushIndex() error

func (*NullIndexer) GetBackend

func (self *NullIndexer) GetBackend() Backend

func (*NullIndexer) Index

func (self *NullIndexer) Index(collection *dal.Collection, records *dal.RecordSet) error

func (*NullIndexer) IndexConnectionString

func (self *NullIndexer) IndexConnectionString() *dal.ConnectionString

func (*NullIndexer) IndexExists

func (self *NullIndexer) IndexExists(collection *dal.Collection, id interface{}) bool

func (*NullIndexer) IndexInitialize

func (self *NullIndexer) IndexInitialize(Backend) error

func (*NullIndexer) IndexRemove

func (self *NullIndexer) IndexRemove(collection *dal.Collection, ids []interface{}) error

func (*NullIndexer) IndexRetrieve

func (self *NullIndexer) IndexRetrieve(collection *dal.Collection, id interface{}) (*dal.Record, error)

func (*NullIndexer) ListValues

func (self *NullIndexer) ListValues(collection *dal.Collection, fields []string, filter filter.Filter) (map[string][]interface{}, error)

func (*NullIndexer) Query

func (self *NullIndexer) Query(collection *dal.Collection, filter filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)

func (*NullIndexer) QueryFunc

func (self *NullIndexer) QueryFunc(collection *dal.Collection, filter filter.Filter, resultFn IndexResultFunc) error

type RedisBackend

type RedisBackend struct {
	Backend
	// contains filtered or unexported fields
}

func (*RedisBackend) CreateCollection

func (self *RedisBackend) CreateCollection(definition *dal.Collection) error

func (*RedisBackend) Delete

func (self *RedisBackend) Delete(name string, ids ...interface{}) error

func (*RedisBackend) DeleteCollection

func (self *RedisBackend) DeleteCollection(name string) error

func (*RedisBackend) DeleteQuery

func (self *RedisBackend) DeleteQuery(collection *dal.Collection, flt *filter.Filter) error

func (*RedisBackend) Exists

func (self *RedisBackend) Exists(name string, id interface{}) bool

func (*RedisBackend) Flush

func (self *RedisBackend) Flush() error

func (*RedisBackend) FlushIndex

func (self *RedisBackend) FlushIndex() error

func (*RedisBackend) GetBackend

func (self *RedisBackend) GetBackend() Backend

func (*RedisBackend) GetCollection

func (self *RedisBackend) GetCollection(name string) (*dal.Collection, error)

func (*RedisBackend) GetConnectionString

func (self *RedisBackend) GetConnectionString() *dal.ConnectionString

func (*RedisBackend) Index

func (self *RedisBackend) Index(collection *dal.Collection, records *dal.RecordSet) error

func (*RedisBackend) IndexConnectionString

func (self *RedisBackend) IndexConnectionString() *dal.ConnectionString

func (*RedisBackend) IndexExists

func (self *RedisBackend) IndexExists(collection *dal.Collection, id interface{}) bool

func (*RedisBackend) IndexInitialize

func (self *RedisBackend) IndexInitialize(Backend) error

func (*RedisBackend) IndexRemove

func (self *RedisBackend) IndexRemove(collection *dal.Collection, ids []interface{}) error

func (*RedisBackend) IndexRetrieve

func (self *RedisBackend) IndexRetrieve(collection *dal.Collection, id interface{}) (*dal.Record, error)

func (*RedisBackend) Initialize

func (self *RedisBackend) Initialize() error

func (*RedisBackend) Insert

func (self *RedisBackend) Insert(name string, recordset *dal.RecordSet) error

func (*RedisBackend) ListCollections

func (self *RedisBackend) ListCollections() ([]string, error)

func (*RedisBackend) ListValues

func (self *RedisBackend) ListValues(collection *dal.Collection, fields []string, flt *filter.Filter) (map[string][]interface{}, error)

func (*RedisBackend) Ping

func (self *RedisBackend) Ping(timeout time.Duration) error

func (*RedisBackend) Query

func (self *RedisBackend) Query(collection *dal.Collection, f *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)

func (*RedisBackend) QueryFunc

func (self *RedisBackend) QueryFunc(collection *dal.Collection, flt *filter.Filter, resultFn IndexResultFunc) error

func (*RedisBackend) RegisterCollection

func (self *RedisBackend) RegisterCollection(collection *dal.Collection)

func (*RedisBackend) Retrieve

func (self *RedisBackend) Retrieve(name string, id interface{}, fields ...string) (*dal.Record, error)

func (*RedisBackend) SetIndexer

func (self *RedisBackend) SetIndexer(indexConnString dal.ConnectionString) error

func (*RedisBackend) String

func (self *RedisBackend) String() string

func (*RedisBackend) Supports

func (self *RedisBackend) Supports(features ...BackendFeature) bool

func (*RedisBackend) Update

func (self *RedisBackend) Update(name string, recordset *dal.RecordSet, target ...string) error

func (*RedisBackend) WithAggregator

func (self *RedisBackend) WithAggregator(collection *dal.Collection) Aggregator

func (*RedisBackend) WithSearch

func (self *RedisBackend) WithSearch(collection *dal.Collection, filters ...*filter.Filter) Indexer

type ResultFunc

type ResultFunc func(ptrToInstance interface{}, err error) // {}

type SerializationFormat

type SerializationFormat string

type SqlBackend

type SqlBackend struct {
	Backend
	Indexer
	Aggregator
	// contains filtered or unexported fields
}

func (*SqlBackend) AggregatorConnectionString

func (self *SqlBackend) AggregatorConnectionString() *dal.ConnectionString

func (*SqlBackend) AggregatorInitialize

func (self *SqlBackend) AggregatorInitialize(parent Backend) error

func (*SqlBackend) Average

func (self *SqlBackend) Average(collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)

func (*SqlBackend) Count

func (self *SqlBackend) Count(collection *dal.Collection, f ...*filter.Filter) (uint64, error)

func (*SqlBackend) CreateCollection

func (self *SqlBackend) CreateCollection(definition *dal.Collection) error

func (*SqlBackend) Delete

func (self *SqlBackend) Delete(name string, ids ...interface{}) error

func (*SqlBackend) DeleteCollection

func (self *SqlBackend) DeleteCollection(collectionName string) error

func (*SqlBackend) DeleteQuery

func (self *SqlBackend) DeleteQuery(collection *dal.Collection, f *filter.Filter) error

DeleteQuery removes records using a filter

func (*SqlBackend) Exists

func (self *SqlBackend) Exists(name string, id interface{}) bool

func (*SqlBackend) Flush

func (self *SqlBackend) Flush() error

func (*SqlBackend) FlushIndex

func (self *SqlBackend) FlushIndex() error

func (*SqlBackend) GetBackend

func (self *SqlBackend) GetBackend() Backend

func (*SqlBackend) GetCollection

func (self *SqlBackend) GetCollection(name string) (*dal.Collection, error)

func (*SqlBackend) GetConnectionString

func (self *SqlBackend) GetConnectionString() *dal.ConnectionString

func (*SqlBackend) GroupBy

func (self *SqlBackend) GroupBy(collection *dal.Collection, groupBy []string, aggregates []filter.Aggregate, f ...*filter.Filter) (*dal.RecordSet, error)

func (*SqlBackend) Index

func (self *SqlBackend) Index(collection *dal.Collection, records *dal.RecordSet) error

Index is a no-op, this should be handled by SqlBackend's Insert() function

func (*SqlBackend) IndexConnectionString

func (self *SqlBackend) IndexConnectionString() *dal.ConnectionString

func (*SqlBackend) IndexExists

func (self *SqlBackend) IndexExists(collection *dal.Collection, id interface{}) bool

func (*SqlBackend) IndexInitialize

func (self *SqlBackend) IndexInitialize(parent Backend) error

func (*SqlBackend) IndexRemove

func (self *SqlBackend) IndexRemove(collection *dal.Collection, ids []interface{}) error

IndexRemove is a no-op, this should be handled by SqlBackend's Delete() function

func (*SqlBackend) IndexRetrieve

func (self *SqlBackend) IndexRetrieve(collection *dal.Collection, id interface{}) (*dal.Record, error)

func (*SqlBackend) Initialize

func (self *SqlBackend) Initialize() error

func (*SqlBackend) Insert

func (self *SqlBackend) Insert(name string, recordset *dal.RecordSet) error

func (*SqlBackend) ListCollections

func (self *SqlBackend) ListCollections() ([]string, error)

func (*SqlBackend) ListValues

func (self *SqlBackend) ListValues(collection *dal.Collection, fields []string, f *filter.Filter) (map[string][]interface{}, error)

func (*SqlBackend) Maximum

func (self *SqlBackend) Maximum(collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)

func (*SqlBackend) Migrate

func (self *SqlBackend) Migrate() error

func (*SqlBackend) Minimum

func (self *SqlBackend) Minimum(collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)

func (*SqlBackend) Ping

func (self *SqlBackend) Ping(timeout time.Duration) error

func (*SqlBackend) Query

func (self *SqlBackend) Query(collection *dal.Collection, f *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)

func (*SqlBackend) QueryFunc

func (self *SqlBackend) QueryFunc(collection *dal.Collection, f *filter.Filter, resultFn IndexResultFunc) error

func (*SqlBackend) RegisterCollection

func (self *SqlBackend) RegisterCollection(collection *dal.Collection)

func (*SqlBackend) Retrieve

func (self *SqlBackend) Retrieve(name string, id interface{}, fields ...string) (*dal.Record, error)

func (*SqlBackend) SetIndexer

func (self *SqlBackend) SetIndexer(indexConnString dal.ConnectionString) error

func (*SqlBackend) String

func (self *SqlBackend) String() string

func (*SqlBackend) Sum

func (self *SqlBackend) Sum(collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)

func (*SqlBackend) Supports

func (self *SqlBackend) Supports(features ...BackendFeature) bool

func (*SqlBackend) Update

func (self *SqlBackend) Update(name string, recordset *dal.RecordSet, target ...string) error

func (*SqlBackend) WithAggregator

func (self *SqlBackend) WithAggregator(collection *dal.Collection) Aggregator

func (*SqlBackend) WithSearch

func (self *SqlBackend) WithSearch(collection *dal.Collection, filters ...*filter.Filter) Indexer

type SqlInitFunc

type SqlInitFunc func(*SqlBackend) (string, string, error)

type SqlPreInitFunc

type SqlPreInitFunc func(*SqlBackend)

Jump to

Keyboard shortcuts

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