disk

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HistoryMax uint64 = 2000

HistoryMax the number of history files(rollback times)

Functions

This section is empty.

Types

type Manager

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

Manager manager

func Open

func Open(dir string) (*Manager, error)

Open open manager,if not exist,create it

func (*Manager) Cancel

func (m *Manager) Cancel(flag []byte) error

Cancel cancel flag,not write to disk

func (*Manager) Close

func (m *Manager) Close()

Close close manager

func (*Manager) Commit

func (m *Manager) Commit(flag []byte) error

Commit write data to disk

func (*Manager) Exist

func (m *Manager) Exist(tbName, key []byte) bool

Exist return true if the key exist

func (*Manager) Get

func (m *Manager) Get(tbName, key []byte) []byte

Get get data

func (*Manager) GetLastFlag

func (m *Manager) GetLastFlag() []byte

GetLastFlag get last flag

func (*Manager) GetNextKey

func (m *Manager) GetNextKey(tbName, preKey []byte) []byte

GetNextKey get next key(visit database)

func (*Manager) OpenFlag

func (m *Manager) OpenFlag(flag []byte) error

OpenFlag open flag

func (*Manager) Rollback

func (m *Manager) Rollback(flag []byte) error

Rollback rollback data of flag

func (*Manager) Set

func (m *Manager) Set(tbName, key, value []byte) error

Set set data, unable rollback

func (*Manager) SetWithFlag

func (m *Manager) SetWithFlag(flag, tbName, key, value []byte) error

SetWithFlag set data with flag, enable rollback

Jump to

Keyboard shortcuts

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