Documentation ¶
Index ¶
- Variables
- func DefaultQueryImplementation(ctx context.Context, indexer Indexer, collection *dal.Collection, ...) (*dal.RecordSet, error)
- func PopulateRecordSetPageDetails(recordset *dal.RecordSet, f *filter.Filter, page IndexPage)
- func RegisterBackend(name string, fn BackendFunc)
- func RegisterSqlInitFunc(scheme string, fn SqlInitFunc)
- func RegisterSqlPreInitFunc(scheme string, fn SqlPreInitFunc)
- type Aggregator
- type Backend
- type BackendFeature
- type BackendFunc
- type CachingBackend
- func (self *CachingBackend) CreateCollection(ctx context.Context, definition *dal.Collection) error
- func (self *CachingBackend) Delete(ctx context.Context, collection string, ids ...interface{}) error
- func (self *CachingBackend) DeleteCollection(ctx context.Context, collection string) error
- func (self *CachingBackend) Exists(ctx context.Context, collection string, id interface{}) bool
- func (self *CachingBackend) Flush() error
- func (self *CachingBackend) GetCollection(collection string) (*dal.Collection, error)
- func (self *CachingBackend) GetConnectionString() *dal.ConnectionString
- func (self *CachingBackend) Initialize() error
- func (self *CachingBackend) Insert(ctx context.Context, collection string, records *dal.RecordSet) error
- func (self *CachingBackend) ListCollections() ([]string, error)
- func (self *CachingBackend) Ping(ctx context.Context, d time.Duration) error
- func (self *CachingBackend) RegisterCollection(c *dal.Collection)
- func (self *CachingBackend) ResetCache()
- func (self *CachingBackend) Retrieve(ctx context.Context, collection string, id interface{}, fields ...string) (*dal.Record, error)
- func (self *CachingBackend) SetIndexer(cs dal.ConnectionString) error
- func (self *CachingBackend) String() string
- func (self *CachingBackend) Supports(feature ...BackendFeature) bool
- func (self *CachingBackend) Update(ctx context.Context, collection string, records *dal.RecordSet, ...) error
- func (self *CachingBackend) WithAggregator(collection *dal.Collection) Aggregator
- func (self *CachingBackend) WithSearch(collection *dal.Collection, filters ...*filter.Filter) Indexer
- type ConnectOptions
- type DynamoBackend
- func (self *DynamoBackend) CreateCollection(ctx context.Context, definition *dal.Collection) error
- func (self *DynamoBackend) Delete(ctx context.Context, name string, ids ...interface{}) error
- func (self *DynamoBackend) DeleteCollection(ctx context.Context, name string) error
- func (self *DynamoBackend) DeleteQuery(ctx context.Context, collection *dal.Collection, flt *filter.Filter) error
- func (self *DynamoBackend) Exists(ctx context.Context, name string, id interface{}) bool
- func (self *DynamoBackend) Flush() error
- func (self *DynamoBackend) FlushIndex() error
- func (self *DynamoBackend) GetBackend() Backend
- func (self *DynamoBackend) GetCollection(name string) (*dal.Collection, error)
- func (self *DynamoBackend) GetConnectionString() *dal.ConnectionString
- func (self *DynamoBackend) Index(ctx context.Context, collection *dal.Collection, records *dal.RecordSet) error
- func (self *DynamoBackend) IndexConnectionString() *dal.ConnectionString
- func (self *DynamoBackend) IndexExists(ctx context.Context, collection *dal.Collection, id interface{}) bool
- func (self *DynamoBackend) IndexInitialize(Backend) error
- func (self *DynamoBackend) IndexRemove(ctx context.Context, collection *dal.Collection, ids []interface{}) error
- func (self *DynamoBackend) IndexRetrieve(ctx context.Context, collection *dal.Collection, id interface{}) (*dal.Record, error)
- func (self *DynamoBackend) Initialize() error
- func (self *DynamoBackend) Insert(ctx context.Context, name string, records *dal.RecordSet) error
- func (self *DynamoBackend) ListCollections() ([]string, error)
- func (self *DynamoBackend) ListValues(ctx context.Context, collection *dal.Collection, fields []string, ...) (map[string][]interface{}, error)
- func (self *DynamoBackend) Ping(ctx context.Context, timeout time.Duration) error
- func (self *DynamoBackend) Query(ctx context.Context, collection *dal.Collection, f *filter.Filter, ...) (*dal.RecordSet, error)
- func (self *DynamoBackend) QueryFunc(ctx context.Context, collection *dal.Collection, flt *filter.Filter, ...) error
- func (self *DynamoBackend) RegisterCollection(definition *dal.Collection)
- func (self *DynamoBackend) Retrieve(ctx context.Context, name string, id interface{}, fields ...string) (*dal.Record, error)
- func (self *DynamoBackend) SetEndpoint(endpoint string)
- func (self *DynamoBackend) SetIndexer(indexConnString dal.ConnectionString) error
- func (self *DynamoBackend) String() string
- func (self *DynamoBackend) Supports(features ...BackendFeature) bool
- func (self *DynamoBackend) Update(ctx context.Context, name string, records *dal.RecordSet, target ...string) error
- func (self *DynamoBackend) WithAggregator(collection *dal.Collection) Aggregator
- func (self *DynamoBackend) WithSearch(collection *dal.Collection, filters ...*filter.Filter) Indexer
- type ElasticsearchIndexer
- func (self *ElasticsearchIndexer) AggregatorConnectionString() *dal.ConnectionString
- func (self *ElasticsearchIndexer) AggregatorInitialize(parent Backend) error
- func (self *ElasticsearchIndexer) Average(ctx context.Context, collection *dal.Collection, field string, ...) (float64, error)
- func (self *ElasticsearchIndexer) Count(ctx context.Context, collection *dal.Collection, flt ...*filter.Filter) (uint64, error)
- func (self *ElasticsearchIndexer) DeleteQuery(ctx context.Context, collection *dal.Collection, f *filter.Filter) error
- func (self *ElasticsearchIndexer) FlushIndex() error
- func (self *ElasticsearchIndexer) GetBackend() Backend
- func (self *ElasticsearchIndexer) GroupBy(ctx context.Context, collection *dal.Collection, groupBy []string, ...) (*dal.RecordSet, error)
- func (self *ElasticsearchIndexer) Index(ctx context.Context, collection *dal.Collection, records *dal.RecordSet) error
- func (self *ElasticsearchIndexer) IndexConnectionString() *dal.ConnectionString
- func (self *ElasticsearchIndexer) IndexExists(ctx context.Context, collection *dal.Collection, id interface{}) bool
- func (self *ElasticsearchIndexer) IndexInitialize(parent Backend) error
- func (self *ElasticsearchIndexer) IndexRemove(ctx context.Context, collection *dal.Collection, ids []interface{}) error
- func (self *ElasticsearchIndexer) IndexRetrieve(ctx context.Context, collection *dal.Collection, id interface{}) (*dal.Record, error)
- func (self *ElasticsearchIndexer) ListValues(ctx context.Context, collection *dal.Collection, fields []string, ...) (map[string][]interface{}, error)
- func (self *ElasticsearchIndexer) Maximum(ctx context.Context, collection *dal.Collection, field string, ...) (float64, error)
- func (self *ElasticsearchIndexer) Minimum(ctx context.Context, collection *dal.Collection, field string, ...) (float64, error)
- func (self *ElasticsearchIndexer) Query(ctx context.Context, collection *dal.Collection, f *filter.Filter, ...) (*dal.RecordSet, error)
- func (self *ElasticsearchIndexer) QueryFunc(ctx context.Context, collection *dal.Collection, f *filter.Filter, ...) error
- func (self *ElasticsearchIndexer) Sum(ctx context.Context, collection *dal.Collection, field string, ...) (float64, error)
- type IndexOperation
- type IndexPage
- type IndexResultFunc
- type IndexSelectionStrategy
- type Indexer
- type IndexerResult
- type IndexerResultFunc
- type Mapper
- type MultiIndex
- func (self *MultiIndex) AddIndexer(indexer Indexer) error
- func (self *MultiIndex) AddIndexerByConnectionString(cs string) error
- func (self *MultiIndex) DeleteQuery(ctx context.Context, collection *dal.Collection, f *filter.Filter) error
- func (self *MultiIndex) EachSelectedIndex(ctx context.Context, collection *dal.Collection, operation IndexOperation, ...) error
- func (self *MultiIndex) FlushIndex() error
- func (self *MultiIndex) GetBackend() Backend
- func (self *MultiIndex) Index(ctx context.Context, collection *dal.Collection, records *dal.RecordSet) error
- func (self *MultiIndex) IndexConnectionString() *dal.ConnectionString
- func (self *MultiIndex) IndexExists(ctx context.Context, collection *dal.Collection, id interface{}) bool
- func (self *MultiIndex) IndexInitialize(backend Backend) error
- func (self *MultiIndex) IndexRemove(ctx context.Context, collection *dal.Collection, ids []interface{}) error
- func (self *MultiIndex) IndexRetrieve(ctx context.Context, collection *dal.Collection, id interface{}) (*dal.Record, error)
- func (self *MultiIndex) ListValues(ctx context.Context, collection *dal.Collection, fields []string, ...) (map[string][]interface{}, error)
- func (self *MultiIndex) Query(ctx context.Context, collection *dal.Collection, filter *filter.Filter, ...) (*dal.RecordSet, error)
- func (self *MultiIndex) QueryFunc(ctx context.Context, collection *dal.Collection, filter *filter.Filter, ...) error
- func (self *MultiIndex) SelectIndex(collection *dal.Collection, operation IndexOperation, lastIndexer int) ([]IndexerResult, error)
- type ResultFunc
- type SqlBackend
- func (self *SqlBackend) AggregatorConnectionString() *dal.ConnectionString
- func (self *SqlBackend) AggregatorInitialize(parent Backend) error
- func (self *SqlBackend) Average(ctx context.Context, collection *dal.Collection, field string, ...) (float64, error)
- func (self *SqlBackend) Count(ctx context.Context, collection *dal.Collection, f ...*filter.Filter) (uint64, error)
- func (self *SqlBackend) CreateCollection(ctx context.Context, definition *dal.Collection) error
- func (self *SqlBackend) Delete(ctx context.Context, name string, ids ...interface{}) error
- func (self *SqlBackend) DeleteCollection(ctx context.Context, collectionName string) error
- func (self *SqlBackend) DeleteQuery(ctx context.Context, collection *dal.Collection, f *filter.Filter) error
- func (self *SqlBackend) Exists(ctx context.Context, name string, id interface{}) bool
- func (self *SqlBackend) Flush() error
- func (self *SqlBackend) FlushIndex() error
- func (self *SqlBackend) GetBackend() Backend
- func (self *SqlBackend) GetCollection(name string) (*dal.Collection, error)
- func (self *SqlBackend) GetConnectionString() *dal.ConnectionString
- func (self *SqlBackend) GroupBy(ctx context.Context, collection *dal.Collection, groupBy []string, ...) (*dal.RecordSet, error)
- func (self *SqlBackend) Index(ctx context.Context, collection *dal.Collection, records *dal.RecordSet) error
- func (self *SqlBackend) IndexConnectionString() *dal.ConnectionString
- func (self *SqlBackend) IndexExists(ctx context.Context, collection *dal.Collection, id interface{}) bool
- func (self *SqlBackend) IndexInitialize(parent Backend) error
- func (self *SqlBackend) IndexRemove(ctx context.Context, collection *dal.Collection, ids []interface{}) error
- func (self *SqlBackend) IndexRetrieve(ctx context.Context, collection *dal.Collection, id interface{}) (*dal.Record, error)
- func (self *SqlBackend) Initialize() error
- func (self *SqlBackend) Insert(ctx context.Context, name string, recordset *dal.RecordSet) error
- func (self *SqlBackend) ListCollections() ([]string, error)
- func (self *SqlBackend) ListValues(ctx context.Context, collection *dal.Collection, fields []string, ...) (map[string][]interface{}, error)
- func (self *SqlBackend) Maximum(ctx context.Context, collection *dal.Collection, field string, ...) (float64, error)
- func (self *SqlBackend) Migrate(ctx context.Context) error
- func (self *SqlBackend) Minimum(ctx context.Context, collection *dal.Collection, field string, ...) (float64, error)
- func (self *SqlBackend) Ping(ctx context.Context, timeout time.Duration) error
- func (self *SqlBackend) Query(ctx context.Context, collection *dal.Collection, f *filter.Filter, ...) (*dal.RecordSet, error)
- func (self *SqlBackend) QueryFunc(ctx context.Context, collection *dal.Collection, f *filter.Filter, ...) error
- func (self *SqlBackend) RegisterCollection(collection *dal.Collection)
- func (self *SqlBackend) Retrieve(ctx context.Context, name string, id interface{}, fields ...string) (*dal.Record, error)
- func (self *SqlBackend) SetIndexer(indexConnString dal.ConnectionString) error
- func (self *SqlBackend) String() string
- func (self *SqlBackend) Sum(ctx context.Context, collection *dal.Collection, field string, ...) (float64, error)
- func (self *SqlBackend) Supports(features ...BackendFeature) bool
- func (self *SqlBackend) Update(ctx context.Context, name string, recordset *dal.RecordSet, target ...string) error
- func (self *SqlBackend) WithAggregator(collection *dal.Collection) Aggregator
- func (self *SqlBackend) WithSearch(collection *dal.Collection, filters ...*filter.Filter) Indexer
- type SqlInitFunc
- type SqlPreInitFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var AutopingTimeout = 5 * time.Second
View Source
var DefaultAmazonRegion = `us-east-1`
View Source
var DefaultAutoregister = false
View Source
var DefaultCompoundJoiner = `:`
View Source
var ElasticsearchBatchFlushCount = 1
View Source
var ElasticsearchBatchFlushInterval = 10 * time.Second
View Source
var ElasticsearchConnectTimeout = 3 * time.Second
View Source
var ElasticsearchDocumentType = `document`
View Source
var ElasticsearchIdentityField = `_id`
View Source
var ElasticsearchRequestTimeout = 30 * time.Second
View Source
var ElasticsearchResponseHeaderTimeout = 10 * time.Second
View Source
var ElasticsearchTLSTimeout = 10 * time.Second
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 NotImplementedError = fmt.Errorf("Not Implemented")
View Source
var SqlArrayFieldHintLength = 131069
View Source
var SqlObjectFieldHintLength = 131071
Functions ¶
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)
Types ¶
type Aggregator ¶
type Aggregator interface { AggregatorConnectionString() *dal.ConnectionString AggregatorInitialize(Backend) error Sum(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error) Count(ctx context.Context, collection *dal.Collection, f ...*filter.Filter) (uint64, error) Minimum(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error) Maximum(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error) Average(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error) GroupBy(ctx context.Context, 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(ctx context.Context, collection string, id interface{}) bool Retrieve(ctx context.Context, collection string, id interface{}, fields ...string) (*dal.Record, error) Insert(ctx context.Context, collection string, records *dal.RecordSet) error Update(ctx context.Context, collection string, records *dal.RecordSet, target ...string) error Delete(ctx context.Context, collection string, ids ...interface{}) error CreateCollection(ctx context.Context, definition *dal.Collection) error DeleteCollection(ctx context.Context, 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(context.Context, time.Duration) error String() string Supports(feature ...BackendFeature) bool SetEndpoint(string) }
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 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 CachingBackend ¶
type CachingBackend struct {
// contains filtered or unexported fields
}
func NewCachingBackend ¶
func NewCachingBackend(parent Backend) *CachingBackend
func (*CachingBackend) CreateCollection ¶
func (self *CachingBackend) CreateCollection(ctx context.Context, definition *dal.Collection) error
func (*CachingBackend) Delete ¶
func (self *CachingBackend) Delete(ctx context.Context, collection string, ids ...interface{}) error
func (*CachingBackend) DeleteCollection ¶
func (self *CachingBackend) DeleteCollection(ctx context.Context, collection string) error
func (*CachingBackend) Exists ¶
func (self *CachingBackend) Exists(ctx context.Context, 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) ListCollections ¶
func (self *CachingBackend) ListCollections() ([]string, error)
func (*CachingBackend) RegisterCollection ¶
func (self *CachingBackend) RegisterCollection(c *dal.Collection)
func (*CachingBackend) ResetCache ¶
func (self *CachingBackend) ResetCache()
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) 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 DynamoBackend ¶
func (*DynamoBackend) CreateCollection ¶
func (self *DynamoBackend) CreateCollection(ctx context.Context, definition *dal.Collection) error
func (*DynamoBackend) Delete ¶
func (self *DynamoBackend) Delete(ctx context.Context, name string, ids ...interface{}) error
func (*DynamoBackend) DeleteCollection ¶
func (self *DynamoBackend) DeleteCollection(ctx context.Context, name string) error
func (*DynamoBackend) DeleteQuery ¶
func (self *DynamoBackend) DeleteQuery(ctx context.Context, collection *dal.Collection, flt *filter.Filter) error
func (*DynamoBackend) Exists ¶
func (self *DynamoBackend) Exists(ctx context.Context, 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(ctx context.Context, collection *dal.Collection, records *dal.RecordSet) error
func (*DynamoBackend) IndexConnectionString ¶
func (self *DynamoBackend) IndexConnectionString() *dal.ConnectionString
func (*DynamoBackend) IndexExists ¶
func (self *DynamoBackend) IndexExists(ctx context.Context, collection *dal.Collection, id interface{}) bool
func (*DynamoBackend) IndexInitialize ¶
func (self *DynamoBackend) IndexInitialize(Backend) error
func (*DynamoBackend) IndexRemove ¶
func (self *DynamoBackend) IndexRemove(ctx context.Context, collection *dal.Collection, ids []interface{}) error
func (*DynamoBackend) IndexRetrieve ¶
func (self *DynamoBackend) IndexRetrieve(ctx context.Context, collection *dal.Collection, id interface{}) (*dal.Record, error)
func (*DynamoBackend) Initialize ¶
func (self *DynamoBackend) Initialize() error
func (*DynamoBackend) ListCollections ¶
func (self *DynamoBackend) ListCollections() ([]string, error)
func (*DynamoBackend) ListValues ¶
func (self *DynamoBackend) ListValues(ctx context.Context, collection *dal.Collection, fields []string, flt *filter.Filter) (map[string][]interface{}, error)
func (*DynamoBackend) Query ¶
func (self *DynamoBackend) Query(ctx context.Context, collection *dal.Collection, f *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)
func (*DynamoBackend) QueryFunc ¶
func (self *DynamoBackend) QueryFunc(ctx context.Context, collection *dal.Collection, flt *filter.Filter, resultFn IndexResultFunc) error
func (*DynamoBackend) RegisterCollection ¶
func (self *DynamoBackend) RegisterCollection(definition *dal.Collection)
func (*DynamoBackend) SetEndpoint ¶ added in v4.0.2
func (self *DynamoBackend) SetEndpoint(endpoint string)
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) WithAggregator ¶
func (self *DynamoBackend) WithAggregator(collection *dal.Collection) Aggregator
func (*DynamoBackend) WithSearch ¶
func (self *DynamoBackend) 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(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)
func (*ElasticsearchIndexer) Count ¶
func (self *ElasticsearchIndexer) Count(ctx context.Context, collection *dal.Collection, flt ...*filter.Filter) (uint64, error)
func (*ElasticsearchIndexer) DeleteQuery ¶
func (self *ElasticsearchIndexer) DeleteQuery(ctx context.Context, 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) Index ¶
func (self *ElasticsearchIndexer) Index(ctx context.Context, collection *dal.Collection, records *dal.RecordSet) error
func (*ElasticsearchIndexer) IndexConnectionString ¶
func (self *ElasticsearchIndexer) IndexConnectionString() *dal.ConnectionString
func (*ElasticsearchIndexer) IndexExists ¶
func (self *ElasticsearchIndexer) IndexExists(ctx context.Context, collection *dal.Collection, id interface{}) bool
func (*ElasticsearchIndexer) IndexInitialize ¶
func (self *ElasticsearchIndexer) IndexInitialize(parent Backend) error
func (*ElasticsearchIndexer) IndexRemove ¶
func (self *ElasticsearchIndexer) IndexRemove(ctx context.Context, collection *dal.Collection, ids []interface{}) error
func (*ElasticsearchIndexer) IndexRetrieve ¶
func (self *ElasticsearchIndexer) IndexRetrieve(ctx context.Context, collection *dal.Collection, id interface{}) (*dal.Record, error)
func (*ElasticsearchIndexer) ListValues ¶
func (self *ElasticsearchIndexer) ListValues(ctx context.Context, collection *dal.Collection, fields []string, f *filter.Filter) (map[string][]interface{}, error)
func (*ElasticsearchIndexer) Maximum ¶
func (self *ElasticsearchIndexer) Maximum(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)
func (*ElasticsearchIndexer) Minimum ¶
func (self *ElasticsearchIndexer) Minimum(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)
func (*ElasticsearchIndexer) Query ¶
func (self *ElasticsearchIndexer) Query(ctx context.Context, collection *dal.Collection, f *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)
func (*ElasticsearchIndexer) QueryFunc ¶
func (self *ElasticsearchIndexer) QueryFunc(ctx context.Context, collection *dal.Collection, f *filter.Filter, resultFn IndexResultFunc) error
type IndexOperation ¶
type IndexOperation int
const ( RetrieveOperation IndexOperation = iota PersistOperation DeleteOperation InspectionOperation )
type IndexResultFunc ¶
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(ctx context.Context, collection *dal.Collection, id interface{}) bool IndexRetrieve(ctx context.Context, collection *dal.Collection, id interface{}) (*dal.Record, error) IndexRemove(ctx context.Context, collection *dal.Collection, ids []interface{}) error Index(ctx context.Context, collection *dal.Collection, records *dal.RecordSet) error QueryFunc(ctx context.Context, collection *dal.Collection, filter *filter.Filter, resultFn IndexResultFunc) error Query(ctx context.Context, collection *dal.Collection, filter *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error) ListValues(ctx context.Context, collection *dal.Collection, fields []string, filter *filter.Filter) (map[string][]interface{}, error) DeleteQuery(ctx context.Context, collection *dal.Collection, f *filter.Filter) error FlushIndex() error GetBackend() Backend }
func MakeIndexer ¶
func MakeIndexer(connection dal.ConnectionString) (Indexer, error)
type IndexerResult ¶
type IndexerResultFunc ¶
type Mapper ¶
type Mapper interface { GetBackend() Backend GetCollection() *dal.Collection Migrate(ctx context.Context) error Drop(ctx context.Context) error Exists(ctx context.Context, id interface{}) bool Create(ctx context.Context, from interface{}) error Get(ctx context.Context, id interface{}, into interface{}) error Update(ctx context.Context, from interface{}) error CreateOrUpdate(ctx context.Context, id interface{}, from interface{}) error Delete(ctx context.Context, ids ...interface{}) error DeleteQuery(ctx context.Context, flt interface{}) error Find(ctx context.Context, flt interface{}, into interface{}) error FindFunc(ctx context.Context, flt interface{}, destZeroValue interface{}, resultFn ResultFunc) error All(ctx context.Context, into interface{}) error Each(ctx context.Context, destZeroValue interface{}, resultFn ResultFunc) error List(ctx context.Context, fields []string) (map[string][]interface{}, error) ListWithFilter(ctx context.Context, fields []string, flt interface{}) (map[string][]interface{}, error) Sum(ctx context.Context, field string, flt interface{}) (float64, error) Count(ctx context.Context, flt interface{}) (uint64, error) Minimum(ctx context.Context, field string, flt interface{}) (float64, error) Maximum(ctx context.Context, field string, flt interface{}) (float64, error) Average(ctx context.Context, field string, flt interface{}) (float64, error) GroupBy(ctx context.Context, fields []string, aggregates []filter.Aggregate, flt interface{}) (*dal.RecordSet, error) }
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(ctx context.Context, collection *dal.Collection, f *filter.Filter) error
func (*MultiIndex) EachSelectedIndex ¶
func (self *MultiIndex) EachSelectedIndex(ctx context.Context, 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(ctx context.Context, collection *dal.Collection, records *dal.RecordSet) error
func (*MultiIndex) IndexConnectionString ¶
func (self *MultiIndex) IndexConnectionString() *dal.ConnectionString
func (*MultiIndex) IndexExists ¶
func (self *MultiIndex) IndexExists(ctx context.Context, collection *dal.Collection, id interface{}) bool
func (*MultiIndex) IndexInitialize ¶
func (self *MultiIndex) IndexInitialize(backend Backend) error
func (*MultiIndex) IndexRemove ¶
func (self *MultiIndex) IndexRemove(ctx context.Context, collection *dal.Collection, ids []interface{}) error
func (*MultiIndex) IndexRetrieve ¶
func (self *MultiIndex) IndexRetrieve(ctx context.Context, collection *dal.Collection, id interface{}) (*dal.Record, error)
func (*MultiIndex) ListValues ¶
func (self *MultiIndex) ListValues(ctx context.Context, collection *dal.Collection, fields []string, filter *filter.Filter) (map[string][]interface{}, error)
func (*MultiIndex) Query ¶
func (self *MultiIndex) Query(ctx context.Context, collection *dal.Collection, filter *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)
func (*MultiIndex) QueryFunc ¶
func (self *MultiIndex) QueryFunc(ctx context.Context, 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 ResultFunc ¶
type ResultFunc func(ptrToInstance interface{}, err error) // {}
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(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)
func (*SqlBackend) Count ¶
func (self *SqlBackend) Count(ctx context.Context, collection *dal.Collection, f ...*filter.Filter) (uint64, error)
func (*SqlBackend) CreateCollection ¶
func (self *SqlBackend) CreateCollection(ctx context.Context, definition *dal.Collection) error
func (*SqlBackend) Delete ¶
func (self *SqlBackend) Delete(ctx context.Context, name string, ids ...interface{}) error
func (*SqlBackend) DeleteCollection ¶
func (self *SqlBackend) DeleteCollection(ctx context.Context, collectionName string) error
func (*SqlBackend) DeleteQuery ¶
func (self *SqlBackend) DeleteQuery(ctx context.Context, collection *dal.Collection, f *filter.Filter) error
DeleteQuery removes records using a filter
func (*SqlBackend) Exists ¶
func (self *SqlBackend) Exists(ctx context.Context, 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) Index ¶
func (self *SqlBackend) Index(ctx context.Context, 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(ctx context.Context, collection *dal.Collection, id interface{}) bool
func (*SqlBackend) IndexInitialize ¶
func (self *SqlBackend) IndexInitialize(parent Backend) error
func (*SqlBackend) IndexRemove ¶
func (self *SqlBackend) IndexRemove(ctx context.Context, 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(ctx context.Context, collection *dal.Collection, id interface{}) (*dal.Record, error)
func (*SqlBackend) Initialize ¶
func (self *SqlBackend) Initialize() error
func (*SqlBackend) ListCollections ¶
func (self *SqlBackend) ListCollections() ([]string, error)
func (*SqlBackend) ListValues ¶
func (self *SqlBackend) ListValues(ctx context.Context, collection *dal.Collection, fields []string, f *filter.Filter) (map[string][]interface{}, error)
func (*SqlBackend) Maximum ¶
func (self *SqlBackend) Maximum(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)
func (*SqlBackend) Minimum ¶
func (self *SqlBackend) Minimum(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)
func (*SqlBackend) Query ¶
func (self *SqlBackend) Query(ctx context.Context, collection *dal.Collection, f *filter.Filter, resultFns ...IndexResultFunc) (*dal.RecordSet, error)
func (*SqlBackend) QueryFunc ¶
func (self *SqlBackend) QueryFunc(ctx context.Context, collection *dal.Collection, f *filter.Filter, resultFn IndexResultFunc) error
func (*SqlBackend) RegisterCollection ¶
func (self *SqlBackend) RegisterCollection(collection *dal.Collection)
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(ctx context.Context, collection *dal.Collection, field string, f ...*filter.Filter) (float64, error)
func (*SqlBackend) Supports ¶
func (self *SqlBackend) Supports(features ...BackendFeature) bool
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)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.