wrapper

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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.

func (*MongoDBProviderWrapper) OpenStore

func (prov *MongoDBProviderWrapper) OpenStore(name string) (storage.Store, error)

OpenStore open store.

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) Close

func (prov *ProviderWrapper) Close() error

Close provider.

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) Ping

func (prov *ProviderWrapper) Ping() error

Ping db.

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) Close

func (store *StoreWrapper) Close() error

Close store.

func (*StoreWrapper) Delete

func (store *StoreWrapper) Delete(key string) error

Delete data.

func (*StoreWrapper) Flush

func (store *StoreWrapper) Flush() error

Flush data.

func (*StoreWrapper) Get

func (store *StoreWrapper) Get(key string) ([]byte, error)

Get 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) Put

func (store *StoreWrapper) Put(key string, value []byte, tags ...storage.Tag) error

Put data.

func (*StoreWrapper) Query

func (store *StoreWrapper) Query(expression string, options ...storage.QueryOption) (storage.Iterator, error)

Query from db.

Jump to

Keyboard shortcuts

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