Documentation
¶
Index ¶
- type Config
- type Redis
- func (r *Redis) AddRoom(room store.Room, ttl time.Duration) error
- func (r *Redis) AddSession(sessID, handle, roomID string, ttl time.Duration) error
- func (r *Redis) ClearSessions(roomID string) error
- func (r *Redis) ExtendRoomTTL(id string, ttl time.Duration) error
- func (r *Redis) Get(key string) ([]byte, error)
- func (r *Redis) GetRoom(id string) (store.Room, error)
- func (r *Redis) GetSession(sessID, roomID string) (store.Sess, error)
- func (r *Redis) RemoveRoom(id string) error
- func (r *Redis) RemoveSession(sessID, roomID string) error
- func (r *Redis) RoomExists(id string) (bool, error)
- func (r *Redis) Set(key string, data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Address string `koanf:"address"` Password string `koanf:"password"` DB int `koanf:"db"` ActiveConns int `koanf:"active_conns"` IdleConns int `koanf:"idle_conns"` Timeout time.Duration `koanf:"timeout"` PrefixRoom string `koanf:"prefix_room"` PrefixSession string `koanf:"prefix_session"` }
Config represents the Redis store config structure.
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
Redis represents the Redis implementation of the Store interface.
func (*Redis) AddSession ¶
AddSession adds a sessionID room to the store.
func (*Redis) ClearSessions ¶
ClearSessions deletes all the sessions in a room.
func (*Redis) ExtendRoomTTL ¶
ExtendRoomTTL extends a room's TTL.
func (*Redis) GetSession ¶
GetSession retrieves a peer session from th store.
func (*Redis) RemoveRoom ¶
RemoveRoom deletes a room from the store.
func (*Redis) RemoveSession ¶
RemoveSession deletes a session ID from a room.
func (*Redis) RoomExists ¶
RoomExists checks if a room exists in the store.
Click to show internal directories.
Click to hide internal directories.