Skip to content

Commit

Permalink
added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dotslashbit committed Jul 3, 2024
1 parent 3c9d025 commit 4a84c82
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions echovault/api_generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 4a84c82

Please sign in to comment.