db

package
v0.0.0-...-60c1ff8 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2019 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KEYS = "keys"
	OPS  = "ops"
)

Variables

View Source
var ReadyDBs = sync.Map{}

Functions

func Decode

func Decode(value []byte, into interface{}) error

func Encode

func Encode(value interface{}) ([]byte, error)

Types

type Config

type Config struct {
	DB *ModuleConf
}

type DB

type DB struct {
	Db       *bolt.DB
	IDSource crdt.ObserveGUIDer
	Options  struct {
		CollisionStrategy string
	}
}

func New

func New(file string) (*DB, error)

func (*DB) Add

func (d *DB) Add(key string, value []byte, mType string) error

func (*DB) AddOp

func (d *DB) AddOp(keyID string, value *crdt.TSValue) error

func (*DB) Close

func (d *DB) Close()

func (*DB) GetUIDFromKey

func (d *DB) GetUIDFromKey(k string) string

func (*DB) HandleCollision

func (d *DB) HandleCollision(values crdt.Payload) crdt.Payload

func (*DB) Init

func (d *DB) Init(path string) error

func (*DB) Load

func (d *DB) Load(key string) (crdt.Payload, bool)

func (*DB) OpLog

func (d *DB) OpLog(from string) [][]byte

func (*DB) Remove

func (d *DB) Remove(key string) error

func (*DB) StoreOpLog

func (d *DB) StoreOpLog(id string, value interface{}) error

type ModuleConf

type ModuleConf struct {
	FileName string
}

func GetConf

func GetConf() *ModuleConf

Jump to

Keyboard shortcuts

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