Documentation ¶
Index ¶
- type MapStorage
- func (m *MapStorage) Add(key string, conn *connection.Connection) bool
- func (m *MapStorage) Get(key string) (*connection.Connection, bool)
- func (m *MapStorage) GetAll() (connections []*connection.Connection)
- func (m *MapStorage) Purge()
- func (m *MapStorage) Remove(key string) bool
- func (m *MapStorage) Set(key string, conn *connection.Connection) bool
- type RedisStorage
- func (r *RedisStorage) Add(key string, conn *connection.Connection) bool
- func (r *RedisStorage) Get(key string) (*connection.Connection, bool)
- func (r *RedisStorage) GetAll() (connections []*connection.Connection)
- func (r *RedisStorage) Purge()
- func (r *RedisStorage) Remove(key string) bool
- func (r *RedisStorage) Set(key string, conn *connection.Connection) bool
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MapStorage ¶
type MapStorage struct { Storage // contains filtered or unexported fields }
func NewMapStorage ¶
func NewMapStorage() *MapStorage
func (*MapStorage) Add ¶
func (m *MapStorage) Add(key string, conn *connection.Connection) bool
func (*MapStorage) Get ¶
func (m *MapStorage) Get(key string) (*connection.Connection, bool)
func (*MapStorage) GetAll ¶
func (m *MapStorage) GetAll() (connections []*connection.Connection)
func (*MapStorage) Purge ¶
func (m *MapStorage) Purge()
func (*MapStorage) Remove ¶
func (m *MapStorage) Remove(key string) bool
func (*MapStorage) Set ¶
func (m *MapStorage) Set(key string, conn *connection.Connection) bool
type RedisStorage ¶
type RedisStorage struct { Storage // contains filtered or unexported fields }
func NewRedisStorage ¶
func NewRedisStorage(host string, port int) *RedisStorage
func (*RedisStorage) Add ¶
func (r *RedisStorage) Add(key string, conn *connection.Connection) bool
func (*RedisStorage) Get ¶
func (r *RedisStorage) Get(key string) (*connection.Connection, bool)
func (*RedisStorage) GetAll ¶
func (r *RedisStorage) GetAll() (connections []*connection.Connection)
func (*RedisStorage) Purge ¶
func (r *RedisStorage) Purge()
func (*RedisStorage) Remove ¶
func (r *RedisStorage) Remove(key string) bool
func (*RedisStorage) Set ¶
func (r *RedisStorage) Set(key string, conn *connection.Connection) bool
type Storage ¶
type Storage interface { Add(key string, conn *connection.Connection) bool Set(key string, conn *connection.Connection) bool Remove(key string) bool Get(key string) (*connection.Connection, bool) GetAll() []*connection.Connection Purge() }
Click to show internal directories.
Click to hide internal directories.