Skip to content

Commit

Permalink
fixed indentation issues
Browse files Browse the repository at this point in the history
Signed-off-by: Edward Liang <[email protected]>
  • Loading branch information
edlng committed Jan 20, 2025
1 parent c1cccbb commit b9a2e76
Showing 1 changed file with 89 additions and 89 deletions.
178 changes: 89 additions & 89 deletions go/api/base_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ func toCStrings(args []string) ([]C.uintptr_t, []C.ulong) {
//
// For example:
//
// result, err := client.Set("key", "value")
// result: "OK"
// result, err := client.Set("key", "value")
// result: "OK"
//
// [valkey.io]: https://valkey.io/commands/set/
func (client *baseClient) Set(key string, value string) (string, error) {
Expand Down Expand Up @@ -377,8 +377,8 @@ func (client *baseClient) GetExWithOptions(key string, options *GetExOptions) (R
//
// For example:
//
// result, err := client.MSet(map[string]string{"key1": "value1", "key2": "value2"})
// result: "OK"
// result, err := client.MSet(map[string]string{"key1": "value1", "key2": "value2"})
// result: "OK"
//
// [valkey.io]: https://valkey.io/commands/mset/
func (client *baseClient) MSet(keyValueMap map[string]string) (string, error) {
Expand Down Expand Up @@ -451,13 +451,13 @@ func (client *baseClient) MSetNX(keyValueMap map[string]string) (bool, error) {
//
// For example:
//
// key1: value1, key2: value2
// result, err := client.MGet([]string{"key1", "key2", "key3"})
// result : {
// api.CreateStringResult("value1),
// api.CreateStringResult("value2"),
// api.CreateNilStringResult()
// }
// key1: value1, key2: value2
// result, err := client.MGet([]string{"key1", "key2", "key3"})
// result : {
// api.CreateStringResult("value1),
// api.CreateStringResult("value2"),
// api.CreateNilStringResult()
// }
//
// [valkey.io]: https://valkey.io/commands/mget/
func (client *baseClient) MGet(keys []string) ([]Result[string], error) {
Expand Down Expand Up @@ -1173,9 +1173,9 @@ func (client *baseClient) HStrLen(key string, field string) (int64, error) {
//
// Example:
//
// _, err := client.HSet("key", map[string]string{"field": "10"})
// hincrByResult, err := client.HIncrBy("key", "field", 1)
// // hincrByResult: 11
// _, err := client.HSet("key", map[string]string{"field": "10"})
// hincrByResult, err := client.HIncrBy("key", "field", 1)
// // hincrByResult: 11
//
// [valkey.io]: https://valkey.io/commands/hincrby/
func (client *baseClient) HIncrBy(key string, field string, increment int64) (int64, error) {
Expand Down Expand Up @@ -1205,9 +1205,9 @@ func (client *baseClient) HIncrBy(key string, field string, increment int64) (in
//
// Example:
//
// _, err := client.HSet("key", map[string]string{"field": "10"})
// hincrByFloatResult, err := client.HIncrByFloat("key", "field", 1.5)
// // hincrByFloatResult: 11.5
// _, err := client.HSet("key", map[string]string{"field": "10"})
// hincrByFloatResult, err := client.HIncrByFloat("key", "field", 1.5)
// // hincrByFloatResult: 11.5
//
// [valkey.io]: https://valkey.io/commands/hincrbyfloat/
func (client *baseClient) HIncrByFloat(key string, field string, increment float64) (float64, error) {
Expand Down Expand Up @@ -1260,9 +1260,9 @@ func (client *baseClient) HScan(key string, cursor string) (string, []string, er
//
// Parameters:
//
// key - The key of the hash.
// cursor - The cursor that points to the next iteration of results. A value of "0" indicates the start of the search.
// options - The [api.HashScanOptions].
// key - The key of the hash.
// cursor - The cursor that points to the next iteration of results. A value of "0" indicates the start of the search.
// options - The [api.HashScanOptions].
//
// Return value:
//
Expand All @@ -1274,13 +1274,13 @@ func (client *baseClient) HScan(key string, cursor string) (string, []string, er
//
// Example:
//
// // Assume key contains a hash {{"a": "1"}, {"b", "2"}}
// opts := options.NewHashScanOptionsBuilder().SetMatch("a")
// resCursor, resCollection, err = client.HScan(key, initialCursor, opts)
// // resCursor = {0 false}
// // resCollection = [{a false} {1 false}]
// // The resCollection only contains the hash map entry that matches with the match option provided with the command
// // input.
// // Assume key contains a hash {{"a": "1"}, {"b", "2"}}
// opts := options.NewHashScanOptionsBuilder().SetMatch("a")
// resCursor, resCollection, err = client.HScan(key, initialCursor, opts)
// // resCursor = {0 false}
// // resCollection = [{a false} {1 false}]
// // The resCollection only contains the hash map entry that matches with the match option provided with the command
// // input.
//
// [valkey.io]: https://valkey.io/commands/hscan/
func (client *baseClient) HScanWithOptions(
Expand Down Expand Up @@ -1628,8 +1628,8 @@ func (client *baseClient) SRem(key string, members []string) (int64, error) {
//
// Parameters:
//
// destination - The key of the destination set.
// keys - The keys from which to retrieve the set members.
// destination - The key of the destination set.
// keys - The keys from which to retrieve the set members.
//
// Return value:
//
Expand Down Expand Up @@ -1844,8 +1844,8 @@ func (client *baseClient) SInter(keys []string) (map[string]struct{}, error) {
//
// Parameters:
//
// destination - The key of the destination set.
// keys - The keys from which to retrieve the set members.
// destination - The key of the destination set.
// keys - The keys from which to retrieve the set members.
//
// Return value:
//
Expand Down Expand Up @@ -2021,14 +2021,14 @@ func (client *baseClient) SPop(key string) (Result[string], error) {
//
// Example:
//
// client.SAdd("myKey", []string{"one", "two"})
// value1, err := client.SMIsMember("myKey", []string{"two", "three"})
// // value1[0].Value(): true
// // value1[1].Value(): false
// // err: nil
// value2, err := client.SPop("nonExistingKey", []string{"one"})
// // value2[0].Value(): false
// // err: nil
// client.SAdd("myKey", []string{"one", "two"})
// value1, err := client.SMIsMember("myKey", []string{"two", "three"})
// // value1[0].Value(): true
// // value1[1].Value(): false
// // err: nil
// value2, err := client.SPop("nonExistingKey", []string{"one"})
// // value2[0].Value(): false
// // err: nil
//
// [valkey.io]: https://valkey.io/commands/smismember/
func (client *baseClient) SMIsMember(key string, members []string) ([]bool, error) {
Expand Down Expand Up @@ -2207,8 +2207,8 @@ func (client *baseClient) SScanWithOptions(
//
// Example:
//
// moved := SMove("set1", "set2", "element")
// fmt.Println(moved.Value()) // Output: true
// moved := SMove("set1", "set2", "element")
// fmt.Println(moved.Value()) // Output: true
//
// [valkey.io]: https://valkey.io/commands/smove/
func (client *baseClient) SMove(source string, destination string, member string) (bool, error) {
Expand Down Expand Up @@ -3563,12 +3563,12 @@ func (client *baseClient) PfCount(keys []string) (int64, error) {
//
// Note:
//
// In cluster mode, if keys in keys map to different hash slots, the command
// will be split across these slots and executed separately for each. This means the command
// is atomic only at the slot level. If one or more slot-specific requests fail, the entire
// call will return the first encountered error, even though some requests may have succeeded
// while others did not. If this behavior impacts your application logic, consider splitting
// the request into sub-requests per slot to ensure atomicity.
// In cluster mode, if keys in keys map to different hash slots, the command
// will be split across these slots and executed separately for each. This means the command
// is atomic only at the slot level. If one or more slot-specific requests fail, the entire
// call will return the first encountered error, even though some requests may have succeeded
// while others did not. If this behavior impacts your application logic, consider splitting
// the request into sub-requests per slot to ensure atomicity.
//
// Parameters:
//
Expand Down Expand Up @@ -3628,12 +3628,12 @@ func (client *baseClient) Type(key string) (string, error) {
//
// Note:
//
// In cluster mode, if keys in keys map to different hash slots, the command
// will be split across these slots and executed separately for each. This means the command
// is atomic only at the slot level. If one or more slot-specific requests fail, the entire
// call will return the first encountered error, even though some requests may have succeeded
// while others did not. If this behavior impacts your application logic, consider splitting
// the request into sub-requests per slot to ensure atomicity.
// In cluster mode, if keys in keys map to different hash slots, the command
// will be split across these slots and executed separately for each. This means the command
// is atomic only at the slot level. If one or more slot-specific requests fail, the entire
// call will return the first encountered error, even though some requests may have succeeded
// while others did not. If this behavior impacts your application logic, consider splitting
// the request into sub-requests per slot to ensure atomicity.
//
// Parameters:
//
Expand Down Expand Up @@ -3679,11 +3679,11 @@ func (client *baseClient) Touch(keys []string) (int64, error) {
//
// Example:
//
// result, err := client.Rename([]string{"key", "newkey"})
// if err != nil {
// // handle error
// }
// fmt.Println(result) // Output: OK
// result, err := client.Rename([]string{"key", "newkey"})
// if err != nil {
// // handle error
// }
// fmt.Println(result) // Output: OK
//
// [valkey.io]: https://valkey.io/commands/rename/
func (client *baseClient) Rename(key string, newKey string) (string, error) {
Expand Down Expand Up @@ -3711,11 +3711,11 @@ func (client *baseClient) Rename(key string, newKey string) (string, error) {
//
// Example:
//
// result, err := client.Renamenx([]string{"key", "newkey"})
// if err != nil {
// // handle error
// }
// fmt.Println(result) // Output: true
// result, err := client.Renamenx([]string{"key", "newkey"})
// if err != nil {
// // handle error
// }
// fmt.Println(result) // Output: true
//
// [valkey.io]: https://valkey.io/commands/renamenx/
func (client *baseClient) Renamenx(key string, newKey string) (bool, error) {
Expand Down Expand Up @@ -4524,11 +4524,11 @@ func (client *baseClient) ZRangeWithScores(
//
// Example:
//
// result, err := client.Persist([]string{"key"})
// if err != nil {
// // handle error
// }
// fmt.Println(result) // Output: true
// result, err := client.Persist([]string{"key"})
// if err != nil {
// // handle error
// }
// fmt.Println(result) // Output: true
//
// [valkey.io]: https://valkey.io/commands/persist/
func (client *baseClient) Persist(key string) (bool, error) {
Expand Down Expand Up @@ -4560,9 +4560,9 @@ func (client *baseClient) Persist(key string) (bool, error) {
// membersScores := map[string]float64{"one": 1.0, "two": 2.0, "three": 3.0 }
// zAddResult, err := client.ZAdd(key1, membersScores)
// zCountRange := options.NewZCountRangeBuilder(
// options.NewInfiniteScoreBoundary(options.NegativeInfinity),
// options.NewInfiniteScoreBoundary(options.PositiveInfinity),
// )
// options.NewInfiniteScoreBoundary(options.NegativeInfinity),
// options.NewInfiniteScoreBoundary(options.PositiveInfinity),
// )
// zCountResult, err := client.ZCount(key1, zCountRange)
// if err != nil {
// // Handle err
Expand Down Expand Up @@ -5370,9 +5370,9 @@ func (client *baseClient) XGroupCreateWithOptions(
//
// Parameters:
//
// key - The key to create.
// ttl - The expiry time (in milliseconds). If 0, the key will persist.
// value - The serialized value to deserialize and assign to key.
// key - The key to create.
// ttl - The expiry time (in milliseconds). If 0, the key will persist.
// value - The serialized value to deserialize and assign to key.
//
// Return value:
//
Expand All @@ -5396,10 +5396,10 @@ func (client *baseClient) Restore(key string, ttl int64, value string) (Result[s
//
// Parameters:
//
// key - The key to create.
// ttl - The expiry time (in milliseconds). If 0, the key will persist.
// value - The serialized value to deserialize and assign to key.
// restoreOptions - Set restore options with replace and absolute TTL modifiers, object idletime and frequency
// key - The key to create.
// ttl - The expiry time (in milliseconds). If 0, the key will persist.
// value - The serialized value to deserialize and assign to key.
// restoreOptions - Set restore options with replace and absolute TTL modifiers, object idletime and frequency
//
// Return value:
//
Expand Down Expand Up @@ -5445,11 +5445,11 @@ func (client *baseClient) RestoreWithOptions(key string, ttl int64,
//
// Example:
//
// result, err := client.Dump([]string{"key"})
// if err != nil {
// // handle error
// }
// fmt.Println(result.Value()) // Output: (Serialized Value)
// result, err := client.Dump([]string{"key"})
// if err != nil {
// // handle error
// }
// fmt.Println(result.Value()) // Output: (Serialized Value)
//
// [valkey.io]: https://valkey.io/commands/dump/
func (client *baseClient) Dump(key string) (Result[string], error) {
Expand Down Expand Up @@ -5505,11 +5505,11 @@ func (client *baseClient) ObjectEncoding(key string) (Result[string], error) {
//
// For example:
//
// result, err := client.Echo("Hello World")
// if err != nil {
// // handle error
// }
// fmt.Println(result.Value()) // Output: Hello World
// result, err := client.Echo("Hello World")
// if err != nil {
// // handle error
// }
// fmt.Println(result.Value()) // Output: Hello World
//
// [valkey.io]: https://valkey.io/commands/echo/
func (client *baseClient) Echo(message string) (Result[string], error) {
Expand Down Expand Up @@ -5930,7 +5930,7 @@ func (client *baseClient) SortStoreWithOptions(
//
// Example:
//
// //Creates the consumer "myconsumer" in consumer group "mygroup"
// // Creates the consumer "myconsumer" in consumer group "mygroup"
// success, err := client.xgroupCreateConsumer("mystream", "mygroup", "myconsumer")
// if err == nil && success {
// fmt.Println("Consumer created")
Expand Down

0 comments on commit b9a2e76

Please sign in to comment.