internal

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendStringArg

func AppendStringArg(args []interface{}, name, value string) []interface{}

AppendStringArg appends the name and value if value is not empty

func ExtractJSONValue

func ExtractJSONValue(val string) ([]interface{}, error)

func Float64

func Float64(arg interface{}) (float64, error)

Float64 takes an interface value and tries to convert it to a float64. We only look at types Redis might return

func Int64

func Int64(arg interface{}) (int64, error)

Int64 takes an interface value and tries to convert it to an int64. We only look at types Redis might return.

func SerializeCountedArgs

func SerializeCountedArgs(name string, incZero bool, args []string) []interface{}

SerializeCountedArgs is used to serialize a string array to NAME <count> values. If incZero is true then NAME 0 will be generated otherwise empty results will not be generated.

func StringToDurationHookFunc

func StringToDurationHookFunc() mapstructure.DecodeHookFunc

StringToDurationHookFunc returns a function that decodes strings to time.Duration (given that the input is in milliseconds)

func StringToMapHookFunc

func StringToMapHookFunc() mapstructure.DecodeHookFunc

SliceToMapHookFunc returns a function that converts a slice to a map[string]interface{} if and only if the output is struct

func ToMap

func ToMap(i interface{}) map[interface{}]interface{}

ToMap converts an interface containing a slice of key/value pairs returned from redis into a map[interface{}]interface{}. If the interface passed in is already a map, return it. Otherwise returns an empty interface (buyer beware)

func ToStringMap

func ToStringMap(input []interface{}) map[string]interface{}

ToStringMap simply converts a slice of key/value pairs returned from Redis into a map[string]interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL