Documentation ¶
Index ¶
- func SetGlogFlags()
- type BotConfig
- type Channel
- type ChatBot
- type MockIRCServer
- type MockQueue
- func (mq *MockQueue) Blpop(keys []string, timeoutsecs uint) (*string, []byte, error)
- func (mq *MockQueue) Llen(key string) (int, error)
- func (mq *MockQueue) Lpush(key string, val []byte) error
- func (mq *MockQueue) Ltrim(key string, start int, end int) error
- func (mq *MockQueue) Ping() (string, error)
- func (mq *MockQueue) Publish(queue string, message []byte) error
- func (mq *MockQueue) Rpush(key string, val []byte) error
- type MockSocket
- type MockStorage
- type PostgresStorage
- type Queue
- type RedisQueue
- func (rq *RedisQueue) Blpop(keys []string, timeoutsecs uint) (*string, []byte, error)
- func (rq *RedisQueue) Llen(key string) (int, error)
- func (rq *RedisQueue) Lpush(key string, val []byte) error
- func (rq *RedisQueue) Ltrim(key string, start int, end int) error
- func (rq *RedisQueue) Ping() (string, error)
- func (rq *RedisQueue) Publish(queue string, message []byte) error
- func (rq *RedisQueue) Rpush(key string, val []byte) error
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetGlogFlags ¶
func SetGlogFlags()
SetGlogFlags walk around a glog issue and force it to log to stderr. It need to be called at the beginning of each test.
Types ¶
type ChatBot ¶
type ChatBot interface { io.Closer Send(channel, msg string) Update(config *BotConfig) IsRunning() bool GetUser() string }
Interface all bots must implement
type MockIRCServer ¶
func NewMockIRCServer ¶
func NewMockIRCServer(msg, port string) *MockIRCServer
func (*MockIRCServer) GotLength ¶
func (srv *MockIRCServer) GotLength() int
func (*MockIRCServer) Run ¶
func (srv *MockIRCServer) Run(t *testing.T)
type MockQueue ¶
Simplistic Queue implementation used by the test suite
func NewMockQueue ¶
func NewMockQueue() *MockQueue
type MockSocket ¶
MockSocket is a dummy implementation of ReadWriteCloser
func (*MockSocket) Close ¶
func (sock *MockSocket) Close() error
type MockStorage ¶
type MockStorage struct {
// contains filtered or unexported fields
}
Simplistic Storage implementation used by the test suite
func (*MockStorage) BotConfig ¶
func (ms *MockStorage) BotConfig() []*BotConfig
type PostgresStorage ¶
type PostgresStorage struct {
// contains filtered or unexported fields
}
func (*PostgresStorage) BotConfig ¶
func (ps *PostgresStorage) BotConfig() []*BotConfig
func (*PostgresStorage) Close ¶
func (ms *PostgresStorage) Close() error
type Queue ¶
type Queue interface { // Publish 'message' on 'queue' (Redis calls it 'channel') Publish(queue string, message []byte) error // Append item to the end (right) of a list. Creates the list if needed. Rpush(key string, val []byte) error // Append item to the beginning (left) of a list. Creates the list if needed. Lpush(key string, val []byte) error // Blocking Pop from one or more Redis lists Blpop(keys []string, timeoutsecs uint) (*string, []byte, error) // Check if queue is available. First return arg is "PONG". Ping() (string, error) // List length Llen(string) (int, error) // Trim list to given range Ltrim(string, int, int) error }
Message queue
func NewRedisQueue ¶
func NewRedisQueue() Queue
type RedisQueue ¶
type RedisQueue struct {
// contains filtered or unexported fields
}
* REDIS WRAPPER * Survives Redis restarts, waits for Redis to be available. * Implements common.Queue
func (*RedisQueue) Ping ¶
func (rq *RedisQueue) Ping() (string, error)
Click to show internal directories.
Click to hide internal directories.