cosmosds

package
v0.0.0-...-251b06b Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Plugins = []plugin.Plugin{
	&Plugin{},
}

Plugins is exported list of plugins that will be loaded

Functions

This section is empty.

Types

type Datastore

type Datastore struct {
	DB *leveldb.DB
	// contains filtered or unexported fields
}

Datastore is the main structure.

func NewDatastore

func NewDatastore(path, tmEndpoint string, opts *Options) (*Datastore, error)

NewDatastore returns a new datastore backed by leveldb

for path == "", an in memory bachend will be chosen

func (*Datastore) Batch

func (d *Datastore) Batch() (ds.Batch, error)

Batch creates the LevelDB batch operator

func (*Datastore) Close

func (d *Datastore) Close() (err error)

Close the LevelDB

func (Datastore) Delete

func (a Datastore) Delete(key ds.Key) (err error)

func (*Datastore) DiskUsage

func (d *Datastore) DiskUsage() (uint64, error)

DiskUsage returns the current disk size used by this levelDB. For in-mem datastores, it will return 0.

func (Datastore) Get

func (a Datastore) Get(key ds.Key) (value []byte, err error)

func (Datastore) GetSize

func (a Datastore) GetSize(key ds.Key) (size int, err error)

func (Datastore) Has

func (a Datastore) Has(key ds.Key) (exists bool, err error)

func (*Datastore) NewTransaction

func (d *Datastore) NewTransaction(readOnly bool) (ds.Txn, error)

NewTransaction creates a transation

func (Datastore) Put

func (a Datastore) Put(key ds.Key, value []byte) (err error)

func (Datastore) Query

func (a Datastore) Query(q dsq.Query) (dsq.Results, error)

func (Datastore) Sync

func (a Datastore) Sync(prefix ds.Key) error

type Options

type Options opt.Options

Options is an alias of syndtr/goleveldb/opt.Options which might be extended in the future.

type Plugin

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

Plugin is the main structure.

func (*Plugin) DatastoreConfigParser

func (p *Plugin) DatastoreConfigParser() fsrepo.ConfigFromMap

DatastoreConfigParser returns a configuration stub for a Cosmos datastore from the given parameters

func (*Plugin) DatastoreTypeName

func (*Plugin) DatastoreTypeName() string

DatastoreTypeName defines the type name of the datastore

func (*Plugin) Init

func (*Plugin) Init(_ *plugin.Environment) error

Init Plugin

func (*Plugin) Name

func (*Plugin) Name() string

Name returns the name of Plugin

func (*Plugin) Version

func (*Plugin) Version() string

Version returns the version of Plugin

Jump to

Keyboard shortcuts

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