mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-25 00:40:29 +08:00
implementing appended for embedded api and started to write tests
This commit is contained in:
@@ -87,5 +87,9 @@ func (server *EchoVault) GetRange(key string, start, end int) (string, error) {
|
||||
//
|
||||
// - "value at key <key> is not a string" - when the value at the keys is not a string.
|
||||
func (server *EchoVault) Append(key string, value string) (int, error) {
|
||||
|
||||
b, err := server.handleCommand(server.context, internal.EncodeCommand([]string{"APPEND", key, value}), nil, false, true)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return internal.ParseIntegerResponse(b)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user