storage

package
v0.0.0-...-9ba4946 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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()
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL