localdb

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: MIT Imports: 6 Imported by: 0

README

本地数据库 使用 github.com/boltdb/bolt

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DBPath = "./data.db"

Functions

This section is empty.

Types

type LocalDB

type LocalDB struct {
	Path   string
	Tables []string
	Conn   *bolt.DB
}

func NewLocalDB

func NewLocalDB(path string, tables []string) *LocalDB

func (*LocalDB) AllKey

func (ldb *LocalDB) AllKey(table string) ([]string, error)

func (*LocalDB) Delete

func (ldb *LocalDB) Delete(table, key string) error

func (*LocalDB) Get

func (ldb *LocalDB) Get(table, key string, data interface{}) error

func (*LocalDB) GetAll

func (ldb *LocalDB) GetAll(table string, fn func(k, v []byte)) error

func (*LocalDB) HasTable

func (ldb *LocalDB) HasTable(table string) bool

func (*LocalDB) Init

func (ldb *LocalDB) Init()

func (*LocalDB) Last

func (ldb *LocalDB) Last(table string) error

func (*LocalDB) Pg

func (ldb *LocalDB) Pg(table string) error

func (*LocalDB) Set

func (ldb *LocalDB) Set(table, key string, data interface{}) error

Jump to

Keyboard shortcuts

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