database

package
v0.0.0-...-331ca6a Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: EUPL-1.2 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Debug tells wheter or not printing debug messages
	Debug bool = false
)

Functions

func Create

func Create(entry types.LocationUpdate) (err error)

Create saves a given entry to the database

func CreateMultiple

func CreateMultiple(entries ...types.LocationUpdate) error

CreateMultiple saves multiple entries to the database.

func Delete

func Delete() error

Delete deletes an entry from the database. Not implemented yet.

func Destroy

func Destroy(filename string) error

Destroy deletes a database from disk

func Open

func Open(filename string) (*storm.DB, error)

Open opens an existing database or creates one when it does not already exist. (i.e. a new .db file will be created), eventually, it points global variable `db` to it.

func Read

func Read(count int) (entries []types.DatabaseEntry, err error)

Read retrieves entries from the database and returns them

func Update

func Update() error

Update updates a single entry of the database. Not implemented yet.

func Use

func Use(database *storm.DB) error

Use tells the database module to actually take a BoltDB database into use. It does so by pointing global variable `db` to it, so transactions can be made (CRUD).

Types

This section is empty.

Jump to

Keyboard shortcuts

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