pkg

package
v0.0.0-...-c61fb85 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ApiJS = `` /* 7425-byte string literal not displayed */

Variables

View Source
var (
	DatabaseAlreadyExists = errors.New("The database already exists")
	KeyAlrearyExists      = errors.New("The key/value already exists")
	KeyNotExists          = errors.New("The key/value not exists")
)

Functions

func CreateDB

func CreateDB(filename string) error

Types

type APIKey

type APIKey struct {
	Key string `json:"key"`
}

type APIKeyValue

type APIKeyValue struct {
	Key   APIKey   `json:"key"`
	Value APIValue `json:"value"`
}

type APIValue

type APIValue struct {
	Value any `json:"value"`
}

type DB

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

func NewDBFromFile

func NewDBFromFile(filename string) (*DB, error)

func (*DB) APIClear

func (db *DB) APIClear()

func (*DB) APIGet

func (db *DB) APIGet(key string) *APIKeyValue

func (*DB) APIGetALL

func (db *DB) APIGetALL() []*APIKeyValue

func (*DB) APIGetALLIF

func (db *DB) APIGetALLIF(f func(APIKeyValue) bool) []*APIKeyValue

func (*DB) APIGetALLKeys

func (db *DB) APIGetALLKeys() []*APIKey

func (*DB) APIGetALLValues

func (db *DB) APIGetALLValues() []*APIValue

func (*DB) APIGetIF

func (db *DB) APIGetIF(f func(APIKeyValue) bool) *APIKeyValue

func (*DB) APIGetKey

func (db *DB) APIGetKey(key string) *APIKey

func (*DB) APIGetValue

func (db *DB) APIGetValue(key string) *APIValue

func (*DB) APIRemove

func (db *DB) APIRemove(key string) bool

func (*DB) APIRemoveAllIF

func (db *DB) APIRemoveAllIF(f func(APIKeyValue) bool) int

func (*DB) APIRemoveIF

func (db *DB) APIRemoveIF(f func(APIKeyValue) bool) bool

func (*DB) APISet

func (db *DB) APISet(key string, value any)

func (*DB) Data

func (s *DB) Data() DBdata

func (*DB) ExistsKey

func (s *DB) ExistsKey(key string) bool

func (*DB) ImplementAPI

func (db *DB) ImplementAPI()

func (*DB) JS

func (s *DB) JS() *goja.Runtime

func (*DB) Save

func (s *DB) Save() error

type DBdata

type DBdata struct {
	Keys KeyValue
}

type KeyValue

type KeyValue struct {
	KeyValueData map[string]any
}

Jump to

Keyboard shortcuts

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