kv

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package kv provides a simple wrap of goleveldb for multi bucket database

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(k []byte) error

Delete deletes a key from the default bucket.

func Get

func Get(k []byte) ([]byte, error)

Get returns a value for the given key from the default bucket.

func Put

func Put(k []byte, v []byte) error

Put push/update a key value pair to the default bucket.

Types

type Bucket

type Bucket interface {
	Get(k []byte) ([]byte, error)
	Put(k []byte, v []byte) error
	Delete(k []byte) error
	Iterator(func(k, v []byte) bool)
}

Bucket is the interface of the database bucket

func New

func New(name string) Bucket

New returns a Bucket with specific name.

Jump to

Keyboard shortcuts

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