Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommandDelete ¶
type CommandDelete struct {
Key []byte
}
CommandDelete represents Delete command.
func (*CommandDelete) Bytes ¶
func (c *CommandDelete) Bytes() ([]byte, error)
Bytes returns byte representation of delete command.
type CommandGet ¶
type CommandGet struct {
Key []byte
}
CommandGet represents Get command.
func (*CommandGet) Bytes ¶
func (c *CommandGet) Bytes() ([]byte, error)
Bytes returns byte representation of get command.
type CommandSet ¶
CommandSet represents Set command.
func (*CommandSet) Bytes ¶
func (c *CommandSet) Bytes() ([]byte, error)
Bytes returns byte representation of join command.
type ResponseDelete ¶
type ResponseDelete struct {
Status Status
}
ResponseDelete represents response for Delete command.
func ParseDeleteResponse ¶
func ParseDeleteResponse(r io.Reader) (*ResponseDelete, error)
ParseDeleteResponse parses response to delete command.
func (*ResponseDelete) Bytes ¶
func (r *ResponseDelete) Bytes() ([]byte, error)
Bytes returns byte representation of response to delete command.
type ResponseGet ¶
ResponseGet represents response for Get command.
func ParseGetResponse ¶
func ParseGetResponse(r io.Reader) (*ResponseGet, error)
ParseGetResponse parses response to get command.
func (*ResponseGet) Bytes ¶
func (r *ResponseGet) Bytes() ([]byte, error)
Bytes returns byte representation of response to get command.
type ResponseSet ¶
type ResponseSet struct {
Status Status
}
ResponseSet represents response for Set command.
func ParseSetResponse ¶
func ParseSetResponse(r io.Reader) (*ResponseSet, error)
ParseSetResponse parses response to set command.
func (*ResponseSet) Bytes ¶
func (r *ResponseSet) Bytes() ([]byte, error)
Bytes returns byte representation of response to set command.
type Status ¶
type Status byte
Status represents the different status types for responses.
const ( // StatusNone represents an empty status. StatusNone Status = iota // StatusOK represents a successful status. StatusOK // StatusError represents an error status. StatusError // StatusKeyNotFound represents a key not found status. StatusKeyNotFound // StatusNotLeader represents a not leader status. StatusNotLeader )