dbs

package
v0.0.0-...-0c63773 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package dbs is a wrapper for Package db Package provides functions for working with map[string]*db.BoltAPI

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBucket

func AddBucket(dbPath, bucketName string) (code int, err error)

AddBucket is a wrapper for *BoltAPI.AddBucket()

func AddRecord

func AddRecord(dbPath, key, value string) (code int, err error)

AddRecord is a wrapper for *BoltAPI.AddRecord()

func CloseDB

func CloseDB(dbPath string) (code int, err error)

CloseDB is a wrapper for *BoltAPI.Close()

func CloseDBs

func CloseDBs()

CloseDBs closes all databases

func CreateDB

func CreateDB(path string) (dbName, dbPath string, code int, err error)

CreateDB is a wrapper for *BoltAPI.Create()

func DeleteBucket

func DeleteBucket(dbPath, bucketName string) (code int, err error)

DeleteBucket is a wrapper for *BoltAPI.DeleteBucket()

func DeleteRecord

func DeleteRecord(dbPath, key string) (code int, err error)

DeleteRecord is a wrapper for *BoltAPI.DeleteRecord()

func EditBucketName

func EditBucketName(dbPath, oldName, newName string) (code int, err error)

EditBucketName is a wrapper for *BoltAPI.EditBucketName()

func EditRecord

func EditRecord(dbPath, oldKey, newKey, newValue string) (code int, err error)

EditRecord is a wrapper for *BoltAPI.EditRecord()

func GetNextRecords

func GetNextRecords(dbPath string) (data db.Data, code int, err error)

GetNextRecords is a wrapper for *BoltAPI.NextRecords()

func GetPrevRecrods

func GetPrevRecrods(dbPath string) (data db.Data, code int, err error)

GetPrevRecrods is a wrapper for *BoltAPI.PrevRecords()

func GetRoot

func GetRoot(dbPath string) (data db.Data, code int, err error)

GetRoot is a wrapper for *BoltAPI.GetRoot()

func Init

func Init()

Init – initializing allDB

func NextBucket

func NextBucket(dbPath, bucket string) (data db.Data, code int, err error)

NextBucket is a wrapper for *BoltAPI.Next()

func OpenDB

func OpenDB(dbPath string, readOnly bool) (dbName string, code int, err error)

OpenDB is a wrapper for *BoltAPI.Open()

func PrevBucket

func PrevBucket(dbPath string) (data db.Data, code int, err error)

PrevBucket is a wrapper for *BoltAPI.Back()

func Search(dbPath, mode, text string) (records []db.Record, path string, recordsAmount int, code int, err error)

Search is a wrapper for *BoltAPI.SearchRegexp() and *BoltAPI.Search()

Types

type DBInfo

type DBInfo struct {
	Name     string `json:"name"`
	DBPath   string `json:"dbPath"`
	Size     int64  `json:"size"`
	ReadOnly bool   `json:"readOnly"`
}

DBInfo consist main info about db

func GetCurrent

func GetCurrent(dbPath string) (info DBInfo, data db.Data, code int, err error)

GetCurrent is a wrapper for *BoltAPI.GetCurrent()

func GetDBsList

func GetDBsList() (list []DBInfo)

GetDBsList returns all opened BoltAPI

Jump to

Keyboard shortcuts

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