persistence

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEntityNotFound = errors.New("entity not found")
	ErrRecordNotFound = errors.New("record not found")
)

Errors

Functions

func Close

func Close()

Close is used to close and clean the db interactions

func Delete

func Delete(entity Entity) error

Delete is used to delete the entry in the proper bucket with the proper key

func Save

func Save(entity Entity) error

Save is used to save the entry in the proper bucket with the proper key

func View

func View(entity Entity) error

View is used to fetch the entry in the proper bucket with the proper key

Types

type Entity

type Entity interface {
	Name() []byte
	Key() ([]byte, error)
	Encode() ([]byte, error)
	Decode(bytes []byte) error
}

Entity is the set of methods which have to be implemented by any entity

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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