Documentation ¶
Index ¶
- Constants
- func CommandBuilder(commandNameIn string, argsIn ...interface{}) (commandNameOut string, argsOut []interface{}, err error)
- func JSONArrAppend(conn redis.Conn, key string, path string, values ...interface{}) (res interface{}, err error)
- func JSONArrIndex(conn redis.Conn, key, path string, jsonValue interface{}, optionalRange ...int) (res interface{}, err error)
- func JSONArrInsert(conn redis.Conn, key, path string, index int, values ...interface{}) (res interface{}, err error)
- func JSONArrLen(conn redis.Conn, key string, path string) (res interface{}, err error)
- func JSONArrPop(conn redis.Conn, key, path string, index int) (res interface{}, err error)
- func JSONArrTrim(conn redis.Conn, key, path string, start, end int) (res interface{}, err error)
- func JSONDebug(conn redis.Conn, subcommand, key, path string) (res interface{}, err error)
- func JSONDel(conn redis.Conn, key string, path string) (res interface{}, err error)
- func JSONForget(conn redis.Conn, key string, path string) (res interface{}, err error)
- func JSONGet(conn redis.Conn, key string, path string, opts ...JSONGetOption) (res interface{}, err error)
- func JSONMGet(conn redis.Conn, path string, keys ...string) (res interface{}, err error)
- func JSONNumIncrBy(conn redis.Conn, key string, path string, number int) (res interface{}, err error)
- func JSONNumMultBy(conn redis.Conn, key string, path string, number int) (res interface{}, err error)
- func JSONObjKeys(conn redis.Conn, key, path string) (res interface{}, err error)
- func JSONObjLen(conn redis.Conn, key, path string) (res interface{}, err error)
- func JSONResp(conn redis.Conn, key string, path string) (res interface{}, err error)
- func JSONSet(conn redis.Conn, key string, path string, obj interface{}, NX bool, XX bool) (res interface{}, err error)
- func JSONStrAppend(conn redis.Conn, key string, path string, jsonstring string) (res interface{}, err error)
- func JSONStrLen(conn redis.Conn, key string, path string) (res interface{}, err error)
- func JSONType(conn redis.Conn, key string, path string) (res interface{}, err error)
- type JSONGetOption
Constants ¶
const ( // PopArrLast gives index of the last element for JSONArrPop PopArrLast = -1 // DebugMemorySubcommand provide the corresponding MEMORY sub commands for JSONDebug DebugMemorySubcommand = "MEMORY" // DebugHelpSubcommand provide the corresponding HELP sub commands for JSONDebug DebugHelpSubcommand = "HELP" // DebugHelpOutput is the output of command JSON.Debug HELP <obj> [path] DebugHelpOutput = "MEMORY <key> [path] - reports memory usage\nHELP - this message" )
Variables ¶
This section is empty.
Functions ¶
func CommandBuilder ¶
func CommandBuilder(commandNameIn string, argsIn ...interface{}) (commandNameOut string, argsOut []interface{}, err error)
CommandBuilder is used to build a command that can be used directly with redigo's conn.Do() This is especially useful if you do not need to conn.Do() and instead need to use the JSON.* commands in a MUTLI/EXEC scenario along with some other operations like GET/SET/HGET/HSET/...
func JSONArrAppend ¶
func JSONArrAppend(conn redis.Conn, key string, path string, values ...interface{}) (res interface{}, err error)
JSONArrAppend to append json value into array at path JSON.ARRAPPEND <key> <path> <json> [json ...]
func JSONArrIndex ¶
func JSONArrIndex(conn redis.Conn, key, path string, jsonValue interface{}, optionalRange ...int) (res interface{}, err error)
JSONArrIndex returns the index of the json element provided and return -1 if element is not present JSON.ARRINDEX <key> <path> <json-scalar> [start [stop]]
func JSONArrInsert ¶
func JSONArrInsert(conn redis.Conn, key, path string, index int, values ...interface{}) (res interface{}, err error)
JSONArrInsert inserts the json value(s) into the array at path before the index (shifts to the right). JSON.ARRINSERT <key> <path> <index> <json> [json ...]
func JSONArrLen ¶
JSONArrLen returns the length of the json array at path JSON.ARRLEN <key> path
func JSONArrPop ¶
JSONArrPop removes and returns element from the index in the array to pop last element use rejson.PopArrLast JSON.ARRPOP <key> [path [index]]
func JSONArrTrim ¶
JSONArrTrim trims an array so that it contains only the specified inclusive range of elements JSON.ARRTRIM <key> <path> <start> <stop>
func JSONDebug ¶
JSONDebug reports information JSON.DEBUG <subcommand & arguments>
JSON.DEBUG MEMORY <key> [path] - report the memory usage in bytes of a value. path defaults to root if not provided. JSON.DEBUG HELP - reply with a helpful message
func JSONForget ¶
JSONForget is an alias for JSONDel
func JSONGet ¶
func JSONGet(conn redis.Conn, key string, path string, opts ...JSONGetOption) (res interface{}, err error)
JSONGet used to get a json object JSON.GET <key>
[INDENT indentation-string] [NEWLINE line-break-string] [SPACE space-string] [NOESCAPE] [path ...]
func JSONMGet ¶
JSONMGet used to get path values from multiple keys JSON.MGET <key> [key ...] <path>
func JSONNumIncrBy ¶
func JSONNumIncrBy(conn redis.Conn, key string, path string, number int) (res interface{}, err error)
JSONNumIncrBy to increment a number by provided amount JSON.NUMINCRBY <key> <path> <number>
func JSONNumMultBy ¶
func JSONNumMultBy(conn redis.Conn, key string, path string, number int) (res interface{}, err error)
JSONNumMultBy to increment a number by provided amount JSON.NUMMULTBY <key> <path> <number>
func JSONObjKeys ¶
JSONObjKeys returns the keys in the object that's referenced by path JSON.OBJKEYS <key> path
func JSONObjLen ¶
JSONObjLen report the number of keys in the JSON Object at path in key JSON.OBJLEN <key> path
func JSONResp ¶
JSONResp returns the JSON in key in Redis Serialization Protocol (RESP). JSON.RESP <key> path
func JSONSet ¶
func JSONSet(conn redis.Conn, key string, path string, obj interface{}, NX bool, XX bool) (res interface{}, err error)
JSONSet used to set a json object JSON.SET <key> <path> <json>
[NX | XX]
func JSONStrAppend ¶
func JSONStrAppend(conn redis.Conn, key string, path string, jsonstring string) (res interface{}, err error)
JSONStrAppend to append a jsonstring to an existing member JSON.STRAPPEND <key> path <json-string>
func JSONStrLen ¶
JSONStrLen to return the length of a string member JSON.STRLEN <key> path
Types ¶
type JSONGetOption ¶
type JSONGetOption interface {
// contains filtered or unexported methods
}
JSONGetOption provides methods various options for the JSON.GET Method
func NewJSONGetOptionIndent ¶
func NewJSONGetOptionIndent(val string) JSONGetOption
NewJSONGetOptionIndent provides new INDENT options for JSON.GET Method
func NewJSONGetOptionNewLine ¶
func NewJSONGetOptionNewLine(val string) JSONGetOption
NewJSONGetOptionNewLine provides new NEWLINE options for JSON.GET Method
func NewJSONGetOptionNoEscape ¶
func NewJSONGetOptionNoEscape() JSONGetOption
NewJSONGetOptionNoEscape provides new NOESCAPE options for JSON.GET Method
func NewJSONGetOptionSpace ¶
func NewJSONGetOptionSpace(val string) JSONGetOption
NewJSONGetOptionSpace provides new SPACE options for JSON.GET Method