database

package module
v0.0.0-...-9f82d97 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	BucketName   string
	DatabaseName string
}

func (*Database) CloseDatabase

func (d *Database) CloseDatabase(db *bolt.DB)

* Close the connection.

Args: Database connectionn - @type: *bolt.DB

func (*Database) CreateBucket

func (d *Database) CreateBucket(database, bucket string)

* Creates a new Bucket in the Database. Retruns an error if the bucket has no name, if it fails to create it or if the bucket name is to long

func (*Database) OpenDatabaseRO

func (d *Database) OpenDatabaseRO(DatabaseName string) *bolt.DB

func (*Database) OpenDatabaseRW

func (d *Database) OpenDatabaseRW(DatabaseName string) *bolt.DB

* Open the connection to the key/value Database. By default if no Database exists it creates a new instance.

Return: Database connection - @type: *bolt.DB

func (*Database) ReadAllValues

func (d *Database) ReadAllValues(database, bucket string, result chan map[int]string)

* Reads all the key/values pairs from the Database Args:

bucket name - @type string

func (*Database) WriteToBucket

func (d *Database) WriteToBucket(database, bucket, value string)

* Writes a key/valye pair to the Database. Args:

bucket name - @type string
value       - @type string

Jump to

Keyboard shortcuts

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