jdb

package
v0.0.0-...-7fcd714 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: Unlicense Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

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

type JDB

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

func NewJDB

func NewJDB(url string) (*JDB, error)

func (*JDB) Delete

func (j *JDB) Delete(collection, resource string) error

Delete locks that database and then attempts to remove the collection/resource specified by path

func (*JDB) Read

func (j *JDB) Read(collection, key string, v interface{}) error

Read a record from the database

func (*JDB) ReadAll

func (j *JDB) ReadAll(collection string) ([]string, error)

ReadAll records from a collection; this is returned as a slice of strings because there is no way of knowing what type the record is.

func (*JDB) ReadAllPerPages

func (j *JDB) ReadAllPerPages(collection string, per, page int) (p []map[string]interface{})

func (*JDB) Write

func (j *JDB) Write(collection, key string, v interface{}) error

Write locks the database and attempts to write the record to the database under the [collection] specified with the [resource] name given

func (*JDB) WriteAll

func (j *JDB) WriteAll(data map[string]interface{}) error

Write locks the database and attempts to write the record to the database under the [collection] specified with the [resource] name given

Jump to

Keyboard shortcuts

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