Documentation ¶
Overview ¶
Package redis connects to a redis database to fetch database updates and logout events.
Index ¶
- type BlockingConn
- type Connection
- type Pool
- type Redis
- func (r *Redis) LogoutEvent(ctx context.Context) ([]string, error)
- func (r *Redis) Publish(ctx context.Context, key string, value []byte) error
- func (r *Redis) RequestMeticSave(request []byte) error
- func (r *Redis) RequestMetricGet(w io.Writer) error
- func (r *Redis) Update(ctx context.Context) (map[string][]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockingConn ¶
type BlockingConn struct{}
BlockingConn is a fake implementation of the redis connection. It does not create a connection but blocks forever.
func (BlockingConn) XADD ¶
func (BlockingConn) XADD(stream, key string, value []byte) error
XADD does nothing.
func (BlockingConn) XREAD ¶
func (BlockingConn) XREAD(count, stream, id string) (interface{}, error)
XREAD blocks forever.
func (BlockingConn) ZINCR ¶
func (BlockingConn) ZINCR(key string, value []byte) error
ZINCR does nothing.
func (BlockingConn) ZRANGE ¶
func (BlockingConn) ZRANGE(key string) (interface{}, error)
ZRANGE does nothing.
type Connection ¶
type Connection interface { XREAD(count, stream, lastID string) (interface{}, error) ZINCR(key string, value []byte) error ZRANGE(key string) (interface{}, error) XADD(stream, field string, value []byte) error }
Connection is the raw connection to a redis server.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool hold the redis connection.
func (*Pool) TestConn ¶
TestConn sends a ping command to redis. Does not return the response, but an error if there is no response.
type Redis ¶
type Redis struct { Conn Connection // contains filtered or unexported fields }
Redis holds the state of the redis receiver.
func (*Redis) LogoutEvent ¶
LogoutEvent is a blocking function that returns, when a session was revoked.
func (*Redis) RequestMeticSave ¶
RequestMeticSave saves how often a request was send.
func (*Redis) RequestMetricGet ¶
RequestMetricGet writes all request with there count as json.