From 4a84c8211dcd6a04cc9b2b47e87a26630d58d915 Mon Sep 17 00:00:00 2001 From: Sahil Date: Thu, 4 Jul 2024 00:48:49 +0530 Subject: [PATCH] added comments --- echovault/api_generic.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/echovault/api_generic.go b/echovault/api_generic.go index d6d83e2b..0f280d28 100644 --- a/echovault/api_generic.go +++ b/echovault/api_generic.go @@ -485,6 +485,17 @@ func (server *EchoVault) IncrBy(key string, value string) (int, error) { return internal.ParseIntegerResponse(b) } +// IncrByFloat increments the floating-point value of the specified key by the given increment. +// If the key does not exist, it is created with an initial value of 0 before incrementing. +// If the value stored at the key is not a float, an error is returned. +// +// Parameters: +// +// `key` - string - The key whose value is to be incremented. +// +// `increment` - float64 - The amount by which to increment the key's value. This can be a positive or negative float. +// +// Returns: The new value of the key after the increment operation as a float64. func (server *EchoVault) IncrByFloat(key string, value string) (float64, error) { // Construct the command cmd := []string{"INCRBYFLOAT", key, value}