database

package
v0.0.0-...-6217932 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2016 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterService

func RegisterService(db *DatabaseService)

Types

type Backend

type Backend interface {
	Get(bucket, key string) ([]byte, error)
	Put(bucket, key string, data []byte) error
	Del(bucket, key string) error
	Scan(bucket, startKey, endKey string, limit int, keysOnly bool) (BackendIterator, error)
}

Backend is the interface that must be implemented by the backend storage driver for the default, RPC-based, database service.

type BackendIterator

type BackendIterator interface {
	Next() (string, []byte, error)
	Close()
}

An iterator for the backend storage. Call Next() until it returns an error.

type DatabaseService

type DatabaseService struct {
	Backend Backend
	// contains filtered or unexported fields
}

func NewDatabaseService

func NewDatabaseService(backend Backend) *DatabaseService

func (*DatabaseService) Del

func (db *DatabaseService) Del(req *DbDelRequest, res *EmptyResponse) error

func (*DatabaseService) Get

func (db *DatabaseService) Get(req *DbGetRequest, res *DbGetResponse) error

func (*DatabaseService) Put

func (db *DatabaseService) Put(req *DbPutRequest, res *EmptyResponse) error

func (*DatabaseService) Scan

func (db *DatabaseService) Scan(req *DbScanRequest, res *DbScanResponse) error

type Datum

type Datum struct {
	Key  string
	Data []byte
}

type DbDelRequest

type DbDelRequest struct {
	Bucket string
	Key    string
}

type DbGetRequest

type DbGetRequest struct {
	Bucket string
	Key    string
}

type DbGetResponse

type DbGetResponse struct {
	Data []byte
}

type DbPutRequest

type DbPutRequest struct {
	Bucket string
	Key    string
	Data   []byte
}

type DbScanRequest

type DbScanRequest struct {
	Bucket   string
	StartKey string
	EndKey   string
	Limit    int
	KeysOnly bool
}

type DbScanResponse

type DbScanResponse struct {
	Results []Datum
}

type EmptyResponse

type EmptyResponse struct{}

Directories

Path Synopsis
The database service consists of a set of high-level operations built on top of a simple key/value store.
The database service consists of a set of high-level operations built on top of a simple key/value store.

Jump to

Keyboard shortcuts

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