treedb

package
v0.0.0-...-b0c7cc0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldAny = iota
	FieldTree
	FieldBinary
)

Variables

View Source
var (
	ErrDBClosed       = errors.New("treedb: db closed")
	ErrDBReadonly     = errors.New("treedb: db is readonly")
	ErrMismatchedType = errors.New("treedb: mismatched type")
	ErrUnknownCommand = errors.New("treedb: unknown command")
	ErrInvalidValue   = errors.New("treedb: invalid value")
)
View Source
var (
	ErrDBExist      = errors.New("treedb: db existed")
	ErrDBMissing    = errors.New("treedb: db missing")
	ErrInvalidParam = errors.New("treedb: invalid parameters")
	ErrDBNoTemplate = errors.New("treedb: template db missing")
)
View Source
var ErrCorruptedData = errors.New("treedb: corrupted data")

Functions

This section is empty.

Types

type CacheCommand

type CacheCommand struct {
	Path    path.Path
	Timeout int64
}

func (*CacheCommand) TreeDBCommand

func (*CacheCommand) TreeDBCommand()

type Command

type Command interface {
	TreeDBCommand()
}

type DB

type DB struct {
	Name    string
	Version uint64
	// contains filtered or unexported fields
}

func (*DB) Close

func (db *DB) Close() error

func (*DB) Request

func (db *DB) Request(reply chan interface{}, cmd Command)

type DeleteCommand

type DeleteCommand struct {
	Path path.Path
}

func (*DeleteCommand) TreeDBCommand

func (*DeleteCommand) TreeDBCommand()

type Directory

type Directory struct {
	Dir string
	// contains filtered or unexported fields
}

func Listen

func Listen(dir string, readonly bool) (*Directory, error)

func (*Directory) Close

func (d *Directory) Close()

Close closes Directory. Ensure that no other calls after closing.

func (*Directory) Delete

func (d *Directory) Delete(name string) error

func (*Directory) Open

func (d *Directory) Open(name string, options *OpenOptions, reply chan interface{}) chan interface{}

func (*Directory) Readonly

func (d *Directory) Readonly() bool

type FieldType

type FieldType uint

type GetCommand

type GetCommand struct {
	Path path.Path
	Type FieldType
}

func (*GetCommand) TreeDBCommand

func (*GetCommand) TreeDBCommand()

type InvalidPathError

type InvalidPathError struct {
	Path string
}

func (*InvalidPathError) Error

func (e *InvalidPathError) Error() string

type NotFoundError

type NotFoundError struct {
	Path string
}

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type NotTreeError

type NotTreeError struct {
	Path string
}

func (*NotTreeError) Error

func (e *NotTreeError) Error() string

type OpenOptions

type OpenOptions struct {
	TemplateDB      string
	CreateIfMissing bool
	ErrorIfExists   bool
	// contains filtered or unexported fields
}

type SetCommand

type SetCommand struct {
	Path  path.Path
	Value interface{}
}

func (*SetCommand) TreeDBCommand

func (*SetCommand) TreeDBCommand()

type TouchCommand

type TouchCommand struct {
	Path path.Path
}

func (*TouchCommand) TreeDBCommand

func (*TouchCommand) TreeDBCommand()

type Version

type Version struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Version) Commit

func (v *Version) Commit(snapshot *leveldb.Snapshot) uint64

func (*Version) Init

func (v *Version) Init(snapshot *leveldb.Snapshot) uint64

func (*Version) Latest

func (v *Version) Latest() (uint64, *leveldb.Snapshot)

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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