AcornStore

package module
v0.0.0-...-41cad47 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2021 License: MIT Imports: 7 Imported by: 0

README

Acorn Store Client API

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

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

func (Collection) Create

func (c Collection) Create() error

Create a new collection in the database Returns an error (nil on success)

func (Collection) Delete

func (c Collection) Delete(condition string) error

Send delete query to the database 'condition' must follow the GJSON Path Syntax (go to https://github.com/tidwall/gjson/blob/master/SYNTAX.md to find out more about the syntax) Returns the error occurred executing the delete query, nil on success

func (Collection) DeleteIt

func (c Collection) DeleteIt() error

Delete the collection in the database Returns an error (nil on success)

func (Collection) Insert

func (c Collection) Insert(document string) error

Send insert query to the database 'document' must be a JSON object Returns the error occurred executing the insert query, nil on success

func (Collection) Retrieve

func (c Collection) Retrieve(condition string) (string, error)

Send retrieve query to the database 'condition' must follow the GJSON Path Syntax (go to https://github.com/tidwall/gjson/blob/master/SYNTAX.md to find out more about the syntax) leave condition empty (i.e. "") to retrieve all the contents Returns:

  • the result of the retreive query in json format
  • the error occurred executing the retreive query, nil on success

func (Collection) Update

func (c Collection) Update(condition, path, value string) error

Send update query to the database 'condition' must follow the GJSON Path Syntax 'path' must follow the GJSON Path Syntax 'value' must be a valid JSON value (go to https://github.com/tidwall/gjson/blob/master/SYNTAX.md to find out more about the syntax) Returns the error occurred executing the update query, nil on success

type Db

type Db struct {
	Ip       string
	Port     string
	Name     string
	Username string
	Password string
	// contains filtered or unexported fields
}

func Connect

func Connect(url string) (*Db, error)

func (*Db) CloseConnection

func (db *Db) CloseConnection()

Close the database connection

func (*Db) Collection

func (db *Db) Collection(name string) Collection

Returns a Collection object representing a collection in the database

func (*Db) CreateCollection

func (db *Db) CreateCollection(name string) (Collection, error)

Create a new collection in the database Returns:

  • Collection object representing the collection
  • error (nil on success)

func (*Db) DeleteCollection

func (db *Db) DeleteCollection(name string) error

Delete the collection in the database Returns an error (nil on success)

func (*Db) DisableDebug

func (db *Db) DisableDebug()

Turn off debug prints

func (*Db) EnableDebug

func (db *Db) EnableDebug()

Turn on debug prints

func (*Db) ShowCollections

func (db *Db) ShowCollections() string

Returns a JSON array of the names of the collections in the database

func (*Db) ShowUserGrants

func (db *Db) ShowUserGrants() string

Returns a JSON array of the grants of the user in the database

type DbClientFunctionalityProvider

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

func (*DbClientFunctionalityProvider) OnClientInit

func (*DbClientFunctionalityProvider) OnClientUpdate

func (fp *DbClientFunctionalityProvider) OnClientUpdate(ci *hurlean.ClientInstance)

func (*DbClientFunctionalityProvider) OnServerMessage

func (fp *DbClientFunctionalityProvider) OnServerMessage(ci *hurlean.ClientInstance, message hurlean.Message)

Jump to

Keyboard shortcuts

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