implementing appended for embedded api and started to write tests

This commit is contained in:
DMcP89
2024-07-01 20:50:48 -04:00
committed by Kelvin Mwinuka
parent 8e4b3e8e3d
commit 19dc8150eb
2 changed files with 45 additions and 1 deletions

View File

@@ -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)
}