boltdb

package
v4.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package boltdb provides tools for using Bolt as a standard persistence layer for services

Index

Constants

View Source
const Driver = "boltdb"

Variables

This section is empty.

Functions

func NewDAO

func NewDAO(ctx context.Context, driver string, dsn string, prefix string) (dao.DAO, error)

NewDAO creates a new handler for the boltdb dao

Types

type DAO

type DAO interface {
	dao.DAO
	DB() *bolt.DB
	Compact(ctx context.Context, opts map[string]interface{}) (int64, int64, error)
}

DAO defines the functions specific to the boltdb dao

type Handler

type Handler struct {
	dao.DAO
	// contains filtered or unexported fields
}

Handler for the main functions of the DAO

func (*Handler) Compact

func (h *Handler) Compact(ctx context.Context, opts map[string]interface{}) (old int64, new int64, err error)

Compact makes a copy of the current DB and replace it as a connection

func (*Handler) DB

func (h *Handler) DB() *bolt.DB

DB returns the bolt DB object

func (*Handler) Init

Init initialises the handler

func (*Handler) LocalAccess

func (h *Handler) LocalAccess() bool

LocalAccess overrides DAO

Jump to

Keyboard shortcuts

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