Documentation ¶
Overview ¶
Package store provides store commands.
Index ¶
- Constants
- type Command
- func (c *Command) Delete(rw io.Writer, req io.Reader) command.Error
- func (c *Command) Flush(rw io.Writer, _ io.Reader) command.Error
- func (c *Command) Get(rw io.Writer, req io.Reader) command.Error
- func (c *Command) GetHandlers() []command.Handler
- func (c *Command) Put(rw io.Writer, req io.Reader) command.Error
- func (c *Command) Query(rw io.Writer, req io.Reader) command.Error
- type DeleteRequest
- type GetRequest
- type GetResponse
- type Provider
- type PutRequest
- type QueryRequest
- type QueryResponse
Constants ¶
View Source
const ( // CommandName package command name. CommandName = "store" // PutCommandMethod command method. PutCommandMethod = "Put" // GetCommandMethod command method. GetCommandMethod = "Get" // QueryCommandMethod command method. QueryCommandMethod = "Query" // DeleteCommandMethod command method. DeleteCommandMethod = "Delete" // FlushCommandMethod command method. FlushCommandMethod = "Flush" )
View Source
const ( // InvalidRequestErrorCode is typically a code for validation errors. InvalidRequestErrorCode = command.Code(iota + command.Store) // PutErrorCode is typically a code for Put errors. PutErrorCode // GetErrorCode is typically a code for Get errors. GetErrorCode // QueryErrorCode is typically a code for Query errors. QueryErrorCode // DeleteErrorCode is typically a code for Delete errors. DeleteErrorCode // FlushErrorCode is typically a code for Flush errors. FlushErrorCode )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command is controller command for store.
func (*Command) GetHandlers ¶
GetHandlers returns list of all commands supported by this controller command.
type DeleteRequest ¶
type DeleteRequest struct {
Key string `json:"key"`
}
DeleteRequest model
This is used for deleting data from the store.
type GetRequest ¶
type GetRequest struct {
Key string `json:"key"`
}
GetRequest model
This is used for getting data (value or tags) from the store.
type GetResponse ¶
type GetResponse struct {
Result []byte `json:"result"`
}
GetResponse model
Represents a response of Get command.
type PutRequest ¶
type PutRequest struct { Key string `json:"key"` Value []byte `json:"value"` Tags []storage.Tag `json:"tags"` }
PutRequest model
This is used for putting data in the store.
type QueryRequest ¶ added in v0.1.6
QueryRequest model
This is used for getting data (values only, without tags) from the store.
type QueryResponse ¶ added in v0.1.6
type QueryResponse struct {
Results [][]byte `json:"results"`
}
QueryResponse model
Represents a response of Query command.
Click to show internal directories.
Click to hide internal directories.