starting implementation of append for embedded server

This commit is contained in:
DMcP89
2024-06-30 14:41:37 -04:00
parent 51198e3c26
commit dd86ea6475

View File

@@ -15,8 +15,9 @@
package echovault
import (
"github.com/echovault/echovault/internal"
"strconv"
"github.com/echovault/echovault/internal"
)
// SetRange replaces a portion of the string at the provided key starting at the offset with a new string.
@@ -76,3 +77,15 @@ func (server *EchoVault) GetRange(key string, start, end int) (string, error) {
}
return internal.ParseStringResponse(b)
}
// Append concatenates the string at the key with the value provided
// If the key does not exists it functions like a SET command
//
// Returns: The lenght of the new concatenated value at key
//
// Errors:
//
// - "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) {
}