From dd86ea6475034c63806b7d3951e65f3ad25ba8c2 Mon Sep 17 00:00:00 2001 From: DMcP89 Date: Sun, 30 Jun 2024 14:41:37 -0400 Subject: [PATCH] starting implementation of append for embedded server --- echovault/api_string.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/echovault/api_string.go b/echovault/api_string.go index 8f33b01..2122f51 100644 --- a/echovault/api_string.go +++ b/echovault/api_string.go @@ -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 is not a string" - when the value at the keys is not a string. +func (server *EchoVault) Append(key string, value string) (int, error) { + +}