Documentation
¶
Index ¶
- type Collection
- type Db
- func (db *Db) CloseConnection()
- func (db *Db) Collection(name string) Collection
- func (db *Db) CreateCollection(name string) (Collection, error)
- func (db *Db) DeleteCollection(name string) error
- func (db *Db) DisableDebug()
- func (db *Db) EnableDebug()
- func (db *Db) ShowCollections() string
- func (db *Db) ShowUserGrants() string
- type DbClientFunctionalityProvider
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 (*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 ¶
Delete the collection in the database Returns an error (nil on success)
func (*Db) ShowCollections ¶
Returns a JSON array of the names of the collections in the database
func (*Db) ShowUserGrants ¶
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 (fp *DbClientFunctionalityProvider) OnClientInit(ci *hurlean.ClientInstance)
func (*DbClientFunctionalityProvider) OnClientUpdate ¶
func (fp *DbClientFunctionalityProvider) OnClientUpdate(ci *hurlean.ClientInstance)
func (*DbClientFunctionalityProvider) OnServerMessage ¶
func (fp *DbClientFunctionalityProvider) OnServerMessage(ci *hurlean.ClientInstance, message hurlean.Message)