Documentation ¶
Index ¶
- type MongoDBProviderWrapper
- type MongoDBStoreWrapper
- func (store *MongoDBStoreWrapper) BulkWrite(models []mongo.WriteModel, opts ...*mongoopts.BulkWriteOptions) error
- func (store *MongoDBStoreWrapper) CreateMongoDBFindOptions(options []storage.QueryOption, isJSONQuery bool) *mongoopts.FindOptions
- func (store *MongoDBStoreWrapper) GetAsRawMap(id string) (map[string]interface{}, error)
- func (store *MongoDBStoreWrapper) GetBulkAsRawMap(keys ...string) ([]map[string]interface{}, error)
- func (store *MongoDBStoreWrapper) PutAsJSON(key string, value interface{}) error
- func (store *MongoDBStoreWrapper) QueryCustom(filter interface{}, options ...*mongoopts.FindOptions) (mongodb.Iterator, error)
- type ProviderWrapper
- func (prov *ProviderWrapper) Close() error
- func (prov *ProviderWrapper) GetOpenStores() []storage.Store
- func (prov *ProviderWrapper) GetStoreConfig(name string) (storage.StoreConfiguration, error)
- func (prov *ProviderWrapper) OpenStore(name string) (storage.Store, error)
- func (prov *ProviderWrapper) Ping() error
- func (prov *ProviderWrapper) SetStoreConfig(name string, config storage.StoreConfiguration) error
- type StoreWrapper
- func (store *StoreWrapper) Batch(operations []storage.Operation) error
- func (store *StoreWrapper) Close() error
- func (store *StoreWrapper) Delete(key string) error
- func (store *StoreWrapper) Flush() error
- func (store *StoreWrapper) Get(key string) ([]byte, error)
- func (store *StoreWrapper) GetBulk(keys ...string) ([][]byte, error)
- func (store *StoreWrapper) GetTags(key string) ([]storage.Tag, error)
- func (store *StoreWrapper) Put(key string, value []byte, tags ...storage.Tag) error
- func (store *StoreWrapper) Query(expression string, options ...storage.QueryOption) (storage.Iterator, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoDBProviderWrapper ¶
type MongoDBProviderWrapper struct { *ProviderWrapper // contains filtered or unexported fields }
MongoDBProviderWrapper wraps a MongoDB aries provider.
func NewMongoDBProvider ¶
func NewMongoDBProvider(p mongoDBProvider, metrics metricsProvider) *MongoDBProviderWrapper
NewMongoDBProvider return new store provider wrapper.
func (*MongoDBProviderWrapper) CreateCustomIndexes ¶
func (prov *MongoDBProviderWrapper) CreateCustomIndexes(storeName string, model ...mongo.IndexModel) error
CreateCustomIndexes creates MongoDB indexes.
type MongoDBStoreWrapper ¶
type MongoDBStoreWrapper struct { *StoreWrapper // contains filtered or unexported fields }
MongoDBStoreWrapper wraps a MongoDB store.
func NewMongoDBStore ¶
func NewMongoDBStore(s storage.Store, metrics metricsProvider) *MongoDBStoreWrapper
NewMongoDBStore return new MongoDB store wrapper.
func (*MongoDBStoreWrapper) BulkWrite ¶
func (store *MongoDBStoreWrapper) BulkWrite(models []mongo.WriteModel, opts ...*mongoopts.BulkWriteOptions) error
BulkWrite executes the mongoDB BulkWrite command using the given WriteModels and BulkWriteOptions.
func (*MongoDBStoreWrapper) CreateMongoDBFindOptions ¶
func (store *MongoDBStoreWrapper) CreateMongoDBFindOptions(options []storage.QueryOption, isJSONQuery bool) *mongoopts.FindOptions
CreateMongoDBFindOptions converts the given storage options to MongoDB options.
func (*MongoDBStoreWrapper) GetAsRawMap ¶
func (store *MongoDBStoreWrapper) GetAsRawMap(id string) (map[string]interface{}, error)
GetAsRawMap fetches the full MongoDB JSON document stored with the given id (_id field in MongoDB). The document is returned as a map (which includes the _id field).
func (*MongoDBStoreWrapper) GetBulkAsRawMap ¶
func (store *MongoDBStoreWrapper) GetBulkAsRawMap(keys ...string) ([]map[string]interface{}, error)
GetBulkAsRawMap fetches the values associated with the given keys and returns the documents (as maps).
func (*MongoDBStoreWrapper) PutAsJSON ¶
func (store *MongoDBStoreWrapper) PutAsJSON(key string, value interface{}) error
PutAsJSON stores the given key and value.
func (*MongoDBStoreWrapper) QueryCustom ¶
func (store *MongoDBStoreWrapper) QueryCustom(filter interface{}, options ...*mongoopts.FindOptions) (mongodb.Iterator, error)
QueryCustom queries for data using the MongoDB find command. The given filter and options are passed directly to the driver. Intended for use alongside the Provider.CreateCustomIndex, Store.PutAsJSON, and Iterator.ValueAsRawMap methods.
type ProviderWrapper ¶
type ProviderWrapper struct {
// contains filtered or unexported fields
}
ProviderWrapper wrap aries provider.
func NewProvider ¶
func NewProvider(p provider, dbType string, metrics metricsProvider) *ProviderWrapper
NewProvider return new store provider wrapper.
func (*ProviderWrapper) GetOpenStores ¶
func (prov *ProviderWrapper) GetOpenStores() []storage.Store
GetOpenStores get stores.
func (*ProviderWrapper) GetStoreConfig ¶
func (prov *ProviderWrapper) GetStoreConfig(name string) (storage.StoreConfiguration, error)
GetStoreConfig get store config.
func (*ProviderWrapper) OpenStore ¶
func (prov *ProviderWrapper) OpenStore(name string) (storage.Store, error)
OpenStore open store.
func (*ProviderWrapper) SetStoreConfig ¶
func (prov *ProviderWrapper) SetStoreConfig(name string, config storage.StoreConfiguration) error
SetStoreConfig set store config.
type StoreWrapper ¶
type StoreWrapper struct {
// contains filtered or unexported fields
}
StoreWrapper wrap aries store.
func NewStore ¶
func NewStore(s storage.Store, dbType string, metrics metricsProvider) *StoreWrapper
NewStore return new store wrapper.
func (*StoreWrapper) Batch ¶
func (store *StoreWrapper) Batch(operations []storage.Operation) error
Batch data.
func (*StoreWrapper) GetBulk ¶
func (store *StoreWrapper) GetBulk(keys ...string) ([][]byte, error)
GetBulk get bulk.
func (*StoreWrapper) GetTags ¶
func (store *StoreWrapper) GetTags(key string) ([]storage.Tag, error)
GetTags get tags.
func (*StoreWrapper) Query ¶
func (store *StoreWrapper) Query(expression string, options ...storage.QueryOption) (storage.Iterator, error)
Query from db.