Documentation ¶
Overview ¶
Package objectstore provides persistent key-value storage, using Google cloud storage to persist the data.
Index ¶
- type KeyValueOperation
- type ObjectStore
- func (os *ObjectStore) Delete(ctx context.Context, key string) error
- func (os *ObjectStore) ForEach(op KeyValueOperation)
- func (os *ObjectStore) Get(key string) []byte
- func (os *ObjectStore) Insert(ctx context.Context, key string, object []byte) error
- func (os *ObjectStore) InsertBulk(ctx context.Context, index map[string][]byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyValueOperation ¶
KeyValueOperation allows you to interact with a given key, value pair.
type ObjectStore ¶
type ObjectStore struct {
// contains filtered or unexported fields
}
ObjectStore provides operations on the set of data in an ObjectStore. Use New to get a handle.
func New ¶
func New(ctx context.Context, client *storage.Client, bucketName, filePrefix string) (*ObjectStore, error)
New will load the current state of an ObjectStore from the given bucket and prefix and return an ObjectStore handle for performing actions.
func (*ObjectStore) Delete ¶
func (os *ObjectStore) Delete(ctx context.Context, key string) error
Delete removes a value for a given key.
func (*ObjectStore) ForEach ¶
func (os *ObjectStore) ForEach(op KeyValueOperation)
ForEach performs operation op on all key, value pairs in the ObjectStore. Note that all of these operations are run from inside a read lock so you will not be able to perform Insert/Delete operation.
func (*ObjectStore) Get ¶
func (os *ObjectStore) Get(key string) []byte
Get returns the value associated with a given key.
func (*ObjectStore) Insert ¶
Insert adds or updates a value for a given key. If the key is already used this new value will replace the existing value.
func (*ObjectStore) InsertBulk ¶
InsertBulk adds, updates, or deletes a group of key-values together.