Documentation
¶
Overview ¶
Package redis provides the handler function for the Redis trigger, as well as access to Redis within Spin components.
Index ¶
- Constants
- func Del(addr string, keys []string) (int64, error)
- func Get(addr, key string) ([]byte, error)
- func Handle(fn func(payload []byte) error)
- func Incr(addr, key string) (int64, error)
- func Publish(addr, channel string, payload []byte) error
- func Sadd(addr string, key string, values []string) (int64, error)
- func Set(addr, key string, payload []byte) error
- func Smembers(addr string, key string) ([]string, error)
- func Srem(addr string, key string, values []string) (int64, error)
- type RedisParameter
- type RedisParameterKind
- type RedisResult
- type RedisResultKind
Constants ¶
View Source
const ( RedisParameterKindInt64 = iota RedisParameterKindBinary )
View Source
const ( RedisResultKindNil = iota RedisResultKindStatus RedisResultKindInt64 RedisResultKindBinary )
Variables ¶
This section is empty.
Functions ¶
func Incr ¶ added in v0.7.0
Increments the number stored at key by one. If the key does not exist, it is set to 0 before performing the operation. An error is returned if the key contains a value of the wrong type or contains a string that can not be represented as integer.
func Sadd ¶ added in v0.9.0
Adds the specified values to the set for the specified key, creating it if it does not already exist.
Types ¶
type RedisParameter ¶ added in v0.9.0
type RedisParameter struct { Kind RedisParameterKind Val interface{} }
type RedisParameterKind ¶ added in v0.9.0
type RedisParameterKind uint8
type RedisResult ¶ added in v0.9.0
type RedisResult struct { Kind RedisResultKind Val interface{} }
func Execute ¶ added in v0.9.0
func Execute(addr string, command string, arguments []RedisParameter) ([]RedisResult, error)
Run the specified Redis command with the specified arguments, returning zero or more results. This is a general-purpose function which should work with any Redis command.
type RedisResultKind ¶ added in v0.9.0
type RedisResultKind uint8
Click to show internal directories.
Click to hide internal directories.