mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-28 10:11:29 +08:00
starting implementation of append for embedded server
This commit is contained in:
@@ -15,8 +15,9 @@
|
|||||||
package echovault
|
package echovault
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/echovault/echovault/internal"
|
|
||||||
"strconv"
|
"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.
|
// 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)
|
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) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user