bdbstore

package
v0.0.78 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

Database is a persistent key-value store. Apart from basic data store functionality it also supports iterating over the key space in byte-wise lexicographical order, setting TTL on Keys and other functionality which can be found here: https://github.com/dgraph-io/badger

func New

func New(dir string, logWriter io.Writer) (*Database, error)

New returns a wrapped BadgerDB object with default options.

func NewWithOptions

func NewWithOptions(opts *badger.Options) (*Database, error)

NewWithOptions returns a wrapped BadgerDB object with the given options used.

func (*Database) Close

func (db *Database) Close() error

Close flushes any pending updates to disk and closes the underlying key-value store.

func (*Database) DeleteMessageRead

func (db *Database) DeleteMessageRead(messageID mail.ID) error

DeleteMessageRead mark message as unread.

func (*Database) GetReadStatus

func (db *Database) GetReadStatus(messageID mail.ID) (bool, error)

GetReadStatus returns true if message is read.

func (*Database) GetTransactions added in v0.0.69

func (db *Database) GetTransactions(protocol, network string, address []byte, skip, limit int32) ([]stores.Transaction, error)

func (*Database) PutMessageRead

func (db *Database) PutMessageRead(messageID mail.ID) error

PutMessageRead mark message as read.

func (*Database) PutTransaction added in v0.0.69

func (db *Database) PutTransaction(protocol, network string, address []byte, tx stores.Transaction) error

Jump to

Keyboard shortcuts

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