Documentation ¶
Index ¶
- type List
- func (l List) Index(index int) (interface{}, error)
- func (l List) LeftPop() (interface{}, error)
- func (l List) LeftPush(value interface{}) (int, error)
- func (l List) Length() (int, error)
- func (l List) Range(start int, end int) ([]interface{}, error)
- func (l List) Remove(value interface{}, occurrences int) (int, error)
- func (l List) RightPop() (interface{}, error)
- func (l List) RightPopLeftPush(newKey string) (interface{}, error)
- func (l List) RightPush(value interface{}) (int, error)
- func (l List) Set(index int, value interface{}) (bool, error)
- type Redis
- type Set
- func (s Set) Add(value interface{}) (bool, error)
- func (s Set) Cardinality() (int, error)
- func (s Set) Diff(key2 string) ([]interface{}, error)
- func (s Set) IsMember(value interface{}) (bool, error)
- func (s Set) Members() ([]interface{}, error)
- func (s Set) Move(otherKey string, value interface{}) (bool, error)
- func (s Set) Pop() (interface{}, error)
- func (s Set) PopMany(quantity int) ([]interface{}, error)
- func (s Set) Remove(value interface{}) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type List ¶
type List struct {
// contains filtered or unexported fields
}
List redis wrapper for list operations
func (List) Index ¶
Index Returns the element at index index in the list stored at key. The index is zero-based, so 0 means the first element, 1 the second element and so on. Negative indices can be used to designate elements starting at the tail of the list. Here, -1 means the last element, -2 means the penultimate and so forth.
When the value at key is not a list, an error is returned.
func (List) LeftPush ¶
LeftPush Insert all the specified values at the head of the list stored at key. If key does not exist, it is created as empty list before performing the push operations. When key holds a value that is not a list, an error is returned.
func (List) Length ¶
Length Returns the length of the list stored at key. If key does not exist, it is interpreted as an empty list and 0 is returned. An error is returned when the value stored at key is not a list.
func (List) Range ¶
Range Returns the specified elements of the list stored at key. The offsets start and stop are zero-based indexes, with 0 being the first element of the list (the head of the list), 1 being the next element and so on.
func (List) Remove ¶
Remove Removes the first count occurrences of elements equal to value from the list stored at key. The count argument influences the operation in the following ways:
count > 0: Remove elements equal to value moving from head to tail. count < 0: Remove elements equal to value moving from tail to head. count = 0: Remove all elements equal to value.
func (List) RightPopLeftPush ¶
RightPopLeftPush Atomically returns and removes the last element (tail) of the list stored at source, and pushes the element at the first element (head) of the list stored at destination.
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
Redis is a wrapper for redigo redis client
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set redis wrapper for set operations
func (Set) Add ¶
Add the specified members to the set stored at key. Specified members that are already a member of this set are ignored. If key does not exist, a new set is created before adding the specified members.
func (Set) Cardinality ¶
Cardinality Returns the set cardinality (number of elements) of the set stored at key.
func (Set) Diff ¶
Diff Returns the members of the set resulting from the difference between the first set and all the successive sets.
func (Set) Move ¶
Move Move member from the set at source to the set at destination. This operation is atomic. In every given moment the element will appear to be a member of source or destination for other clients.