database

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: GPL-3.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NewDatabase = func(name string, databaseId *Database) (error errno.Error) {
		return errno.ErrorNone
	}

	DatabaseGet = func(databaseId Database, key string, data *byte) (error errno.Error) {
		return errno.ErrorNone
	}

	DatabaseGetSize = func(databaseId Database, key string, size *uint32) (error errno.Error) {
		return errno.ErrorNone
	}

	DatabasePut = func(databaseId Database, key string, data *byte, dataSize uint32) (error errno.Error) {
		return errno.ErrorNone
	}

	DatabaseClose = func(databaseId Database) (error errno.Error) {
		return errno.ErrorNone
	}

	DatabaseDelete = func(databaseId Database, key string) (error errno.Error) {
		return errno.ErrorNone
	}

	DatabaseList = func(databaseId Database, key string, data *byte) (error errno.Error) {
		return errno.ErrorNone
	}

	DatabaseListSize = func(databaseId Database, key string, size *uint32) (error errno.Error) {
		return errno.ErrorNone
	}
)

Functions

This section is empty.

Types

type Database

type Database uint32

func New

func New(name string) (Database, error)

New creates a new database Returns a database and error

func (Database) Close

func (d Database) Close() error

Close closes the database Returns an error

func (Database) Delete

func (d Database) Delete(key string) error

Delete removes an entry from the database Retuns an error

func (Database) Get

func (d Database) Get(key string) ([]byte, error)

Get retrieves the given key from the database. Returns the data of the key and an error.

func (Database) List

func (d Database) List(prefix string) ([]string, error)

List uses the prefix given to get a list of keys that use the prefix in the database Returns all keys found and an error

func (Database) Put

func (d Database) Put(key string, data []byte) error

Put writes the key and data into the database. Returns an error

type DatabaseData

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

Jump to

Keyboard shortcuts

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