Documentation ¶
Index ¶
- type Redis
- func (r *Redis) AddApplause(userID int) error
- func (r *Redis) ChangedKeys(from, to int) ([]string, error)
- func (r *Redis) Data(keys []string) (map[string]json.RawMessage, error)
- func (r *Redis) FullData() (data map[string]json.RawMessage, max int, min int, err error)
- func (r *Redis) GetApplause(since int64) (int, error)
- func (r *Redis) GetSession(sessionID string) ([]byte, error)
- func (r *Redis) ReceiveNotify(closing <-chan struct{}) (message string, err error)
- func (r *Redis) SendNotify(message []byte) error
- func (r *Redis) TestReadConn() error
- func (r *Redis) TestWriteConn() error
- func (r *Redis) Update(closing <-chan struct{}) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
Redis holds the connection to redis.
func (*Redis) AddApplause ¶
AddApplause adds a user to the applause set.
Also deletes applause that is older then a minute
func (*Redis) ChangedKeys ¶
ChangedKeys returns all keys in the changeidkey higher from and lower or equal to.
func (*Redis) Data ¶
Data returns the data from redis for specific keys from the full data hash key.
If a key does not exist, the value in the returned dict is nil.
func (*Redis) FullData ¶
FullData gets all data from redis. It also gets the min and max change id in a atomic way.
func (*Redis) GetApplause ¶
GetApplause returns the amount of applause sind a time.
func (*Redis) GetSession ¶
GetSession returns the session data for a sessionID.
func (*Redis) ReceiveNotify ¶
ReceiveNotify returns the next notify message.
func (*Redis) SendNotify ¶
SendNotify publishes a notify message in redis.
func (*Redis) TestReadConn ¶
TestReadConn sends a ping command to redis. Does not return the response, but an error if there is no response.
func (*Redis) TestWriteConn ¶
TestWriteConn sends a ping command to redis. Does not return the response, but an error if there is no response.