badger

package
v0.2.2-0...-86e9763 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

Database is a wrapper around a badger database, providing high level functions to act a kipp entry database.

func Open

func Open(name string) (*Database, error)

Open opens a new badger database.

func (*Database) Close

func (db *Database) Close(context.Context) error

Close closes the database.

func (*Database) Create

func (db *Database) Create(_ context.Context, e database.Entry) error

Create sets the key, slug with the gob encoded value of e.

func (*Database) Lookup

func (db *Database) Lookup(_ context.Context, slug string) (e database.Entry, err error)

Lookup looks up the named entry.

func (*Database) Ping

func (db *Database) Ping(context.Context) error

Ping pings the database.

func (*Database) Remove

func (db *Database) Remove(_ context.Context, slug string) error

Remove removes the key with the given slug.

Jump to

Keyboard shortcuts

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