commands

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ErrCouldNotCloseDatabase = 1006
View Source
const ErrDbDoesNotOpen = 1001
View Source
const ErrKeyIsEmpty = 1004
View Source
const ErrKeyNotFound = 1007
View Source
const ErrOpeningDatabase = 1002
View Source
const ErrUnableToDelete = 1005
View Source
const ErrUnableToWrite = 1003
View Source
const FileWriteErr = 1008

Variables

This section is empty.

Functions

func AppError

func AppError(code int) string

The wrapper for outputting errors in the application Returns the text of the error

func Close

func Close() string

Command close the database. It is safe to close the database file leveldb.

Returns a string containing information about the result of the operation.

func Delete

func Delete(key string) string

Command deleting records. The command to remove records from the database by key.

Returns a string containing information about the result of the operation.

func Export added in v0.3.0

func Export(key, fileName string) string

The command exports a value for the selected key to file with specified filename.

Returns a string containing information about the result of the operation.

func Get

func Get(key, format string) string

The command get a value. It gets the value for the selected key.

Returns a string containing information about the result of the operation.

func Open

func Open(file string) string

The command to open the database. If the database does not exist, it will create a new database.

Returns a string containing information about the result of the operation.

func Set

func Set(key, value string) string

The command set a value. It sets the value for the selected key.

Returns a string containing information about the result of the operation.

func ShowByPrefix

func ShowByPrefix(prefix, format string) string

It shows the contents of the database prefix filtering. Use the field `format` for specifying the display format of data. The list of possible values of format options: raw (default), geohash, bson, int64, float64

Returns a string containing information about the result of the operation.

func ShowByRange

func ShowByRange(start, limit, format string) string

It shows the contents of the database range filtering. Use the field `format` for specifying the display format of data. The list of possible values of format options: raw (default), geohash, bson, int64, float64

Returns a string containing information about the result of the operation.

func ShowLimit added in v0.4.0

func ShowLimit(limit int, format string) string

ShowLimit It shows all content of the database limited by the limit. Use the field `format` for specifying the display format of data. The list of possible values of format options: raw (default), geohash, bson, int64, float64

Returns a string containing information about the result of the operation.

Types

This section is empty.

Jump to

Keyboard shortcuts

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