persistence

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltPersistence

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

BoltPersistence creates a persistence services backed by an on-disk bolt database

func (*BoltPersistence) Check

func (bp *BoltPersistence) Check(bucket string, name string) (bool, error)

Check returns true if the record exists in the given bucket.

func (*BoltPersistence) Close

func (bp *BoltPersistence) Close()

Close closes the databases

func (*BoltPersistence) Load

func (bp *BoltPersistence) Load(bucket string, name string, value interface{}) error

Load reads a value from a given bucket.

func (*BoltPersistence) Open

func (bp *BoltPersistence) Open(handle string) error

Open opens a database

func (*BoltPersistence) Persist

func (bp *BoltPersistence) Persist(bucket string, name string, value interface{}) error

Persist stores a record in the database

func (*BoltPersistence) Setup

func (bp *BoltPersistence) Setup(buckets []string) error

Setup initializes the given buckets if they do not exist in the database

type Service

type Service interface {
	Open(handle string) error
	Setup(buckets []string) error
	Persist(bucket string, name string, value interface{}) error
	Check(bucket string, name string) (bool, error)
	Load(bucket string, name string, value interface{}) error
	Close()
}

Service provides a consistent interface for interacting with on-disk, in-memory or server-backed storage

Jump to

Keyboard shortcuts

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