Documentation ¶
Overview ¶
Package protocol provides database's socket IO primitives.
Index ¶
- type DBSocket
- type StorageSession
- func (i *StorageSession) Commit() string
- func (i *StorageSession) Get(key string) string
- func (i *StorageSession) NumEqualsTo(val string) uint64
- func (i *StorageSession) Rollback() string
- func (i *StorageSession) Set(key, value string)
- func (i *StorageSession) Tx() string
- func (i *StorageSession) Unset(key string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBSocket ¶
type DBSocket struct {
// contains filtered or unexported fields
}
DBSocket is a sock scanner that reads commands and returns their output.
type StorageSession ¶
type StorageSession struct {
// contains filtered or unexported fields
}
StorageSession handles requests for a connection and returns output strings.
func NewSession ¶
func NewSession(stor storage.DB) *StorageSession
NewSession creates and returns new StorageSession.
func (*StorageSession) Commit ¶
func (i *StorageSession) Commit() string
Commit commits current transaction in progress. Returns nothing on success, error on unexpected error, or NO TRANSACTION if not in transaction.
func (*StorageSession) Get ¶
func (i *StorageSession) Get(key string) string
Get returns the variable's value by its key. Returns NULL if not found or error's text on unexpected error.
func (*StorageSession) NumEqualsTo ¶
func (i *StorageSession) NumEqualsTo(val string) uint64
NumEqualsTo returns variables' count by their value.
func (*StorageSession) Rollback ¶
func (i *StorageSession) Rollback() string
Rollback rolls back current transaction in progress (if exists). Returns nothing on success, error on unexpected error, or NO TRANSACTION if not in transaction.
func (*StorageSession) Set ¶
func (i *StorageSession) Set(key, value string)
Set sets the variable's value by its key.
func (*StorageSession) Tx ¶
func (i *StorageSession) Tx() string
Tx creates and enters new transaction.
func (*StorageSession) Unset ¶
func (i *StorageSession) Unset(key string)
Unset deletes the variable by its key.