Documentation ¶
Index ¶
Constants ¶
View Source
const ( ActionHandshake = iota ActionGet ActionSet )
View Source
const ( StatusSuccess = iota StatusClientError StatusServerError StatusKeyNotFound )
Variables ¶
View Source
var (
ErrUnknownAction = errors.New("Unknown Action")
)
Errors
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { SubCommand Id string Action int }
Command is the root element for issuing a command from a client to a server.
func DecodeCommand ¶
DecodeCommand reads from an io.Reader and decodes the command.
func NewCommand ¶
func NewCommand(id string, sb SubCommand) *Command
NewCommand constructs and returns a new Command.
type GetCommand ¶
type GetCommand struct {
Key string
}
GetCommand is get command that can be issued by a client to a server.
func NewGetCommand ¶
func NewGetCommand(key string) GetCommand
NewGetCommand creates a new GetCommand to be used as a SubCommand on a Command.
type GetResult ¶
func NewGetResult ¶
type HandshakeCommand ¶
type HandshakeCommand struct {
UserAgent string
}
HandshakeCommand is the first command that should be issued to a server imediately after opening a new connection.
func NewHandshakeCommand ¶
func NewHandshakeCommand(agent string) HandshakeCommand
NewHandshakeCommand creates a new HandshakeCommand to be used as a SubCommand on a Command.
type HandshakeResult ¶
type HandshakeResult struct {
ClientId string
}
func NewHandshakeResult ¶
func NewHandshakeResult(clientId string) HandshakeResult
type Result ¶
func DecodeResult ¶
DecodeResult reads from an io.Reader and decodes a result.
type SetCommand ¶
type SetCommand struct { Key string Value string Expiry int64 // Todo: Should this be Time instead, does capnp suppor that? }
func NewSetCommand ¶
func NewSetCommand(key, value string, expiry int64) SetCommand
type SubCommand ¶
type SubCommand interface {
// contains filtered or unexported methods
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.