core

package
v0.0.0-...-93bf087 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: ISC Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NoPromptErr = errors.New("no prompt has been configured")
)

Functions

This section is empty.

Types

type Context

type Context struct {
	*lmdb.Env
	DBI lmdb.DBI

	Cursor *Cursor
	// contains filtered or unexported fields
}

func NewContext

func NewContext(dbPath string, size int64, ro bool, dir bool, dbs int, writer io.Writer) *Context

func (*Context) Close

func (c *Context) Close()

func (*Context) CloseCursor

func (c *Context) CloseCursor()

func (*Context) Output

func (c *Context) Output(data []byte)

func (*Context) OutputErr

func (c *Context) OutputErr(err error)

func (*Context) PrepareCursor

func (c *Context) PrepareCursor(prefix []byte, includeValues bool) error

func (*Context) Prompt

func (c *Context) Prompt() (string, error)

func (*Context) SetPrompter

func (c *Context) SetPrompter(Prompter Prompter)

func (*Context) SwitchDB

func (c *Context) SwitchDB(name string) error

func (*Context) WithinRead

func (c *Context) WithinRead(f func(*lmdb.Txn) error) error

func (*Context) WithinWrite

func (c *Context) WithinWrite(f func(*lmdb.Txn) error) error

type Cursor

type Cursor struct {
	*lmdb.Cursor

	Prefix        []byte
	IncludeValues bool
	// contains filtered or unexported fields
}

type Prompter

type Prompter interface {
	Prompt(string) (string, error)
	AppendHistory(string)
}

Jump to

Keyboard shortcuts

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