Documentation
¶
Index ¶
- Constants
- func SaveStore(store *StandardStore, writer io.Writer) error
- func SaveStoreToFile(store *StandardStore, name string) error
- type Client
- type Command
- type CommandHandler
- type CommandService
- type Reply
- type Server
- type StandardStore
- func (st *StandardStore) Delete(key string)
- func (st *StandardStore) Exists(key string) bool
- func (st *StandardStore) Flush()
- func (st *StandardStore) Get(key string) string
- func (st *StandardStore) Keys() []string
- func (st *StandardStore) Set(key string, value string)
- func (st *StandardStore) Size() int64
- type Store
Constants ¶
View Source
const ( TypeAck = "ACK" TypeNil = "NIL" TypeStr = "STR" TypeInt = "INT" TypeArr = "ARR" TypeErr = "ERR" )
View Source
const ( ErrUnknownCmd = "unknown command" ErrWrongArgs = "wrong number of arguments for command" ErrWrongType = "WRONGTYPE operation against a key holding the wrong kind of value" )
Variables ¶
This section is empty.
Functions ¶
func SaveStoreToFile ¶
func SaveStoreToFile(store *StandardStore, name string) error
Types ¶
type Command ¶
func MakeCommand ¶
type CommandHandler ¶
type CommandHandler struct {
// contains filtered or unexported fields
}
func NewCommandHandler ¶
func NewCommandHandler(srv *CommandService) *CommandHandler
func (*CommandHandler) ServeHTTP ¶
func (h *CommandHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*CommandHandler) WaitClose ¶
func (h *CommandHandler) WaitClose()
type CommandService ¶
type CommandService struct {
// contains filtered or unexported fields
}
func NewCommandService ¶
func NewCommandService(store Store) *CommandService
func (*CommandService) ExecCommand ¶
func (srv *CommandService) ExecCommand(c Command) (*Reply, error)
type Reply ¶
func NewReplyArray ¶
func NewReplyErr ¶
func NewReplyInteger ¶
func NewReplyNil ¶
func NewReplyNil() *Reply
func NewReplyOK ¶
func NewReplyOK() *Reply
type StandardStore ¶
type StandardStore struct {
// contains filtered or unexported fields
}
func LoadStoreFromFile ¶
func LoadStoreFromFile(name string) (*StandardStore, error)
func NewStandardStore ¶
func NewStandardStore() *StandardStore
func (*StandardStore) Delete ¶
func (st *StandardStore) Delete(key string)
func (*StandardStore) Exists ¶
func (st *StandardStore) Exists(key string) bool
func (*StandardStore) Flush ¶
func (st *StandardStore) Flush()
func (*StandardStore) Get ¶
func (st *StandardStore) Get(key string) string
func (*StandardStore) Keys ¶
func (st *StandardStore) Keys() []string
func (*StandardStore) Set ¶
func (st *StandardStore) Set(key string, value string)
func (*StandardStore) Size ¶
func (st *StandardStore) Size() int64
Click to show internal directories.
Click to hide internal directories.