commands

package
v0.0.0-...-2ca7576 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2016 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 Redibot

type Redibot struct {
	Slack        *slack.Slack
	RedisManager *RedisManager
}

Redibot facilitates the Slack and Redis connections required for the bot to operate

func NewRedibot

func NewRedibot(token string) *Redibot

NewRedibot creates a new instance of Redibot

func (*Redibot) Connect

func (r *Redibot) Connect(parts []string)

Connect sets up a new redis connection

func (*Redibot) Do

func (r *Redibot) Do(m *slack.Message, parts []string)

Do executes an arbitrary redis command

func (*Redibot) GetWSMessage

func (r *Redibot) GetWSMessage() (*slack.Message, *string, error)

GetWSMessage gets a message off the web socket connection

func (*Redibot) Pub

func (r *Redibot) Pub(m *slack.Message, parts []string)

Pub publishes a message over the websocket

func (*Redibot) Sub

func (r *Redibot) Sub(m *slack.Message, parts []string)

Sub subscribes to a new web socket connection

type RedisManager

type RedisManager struct {
	// contains filtered or unexported fields
}

RedisManager manages redis server pools

func NewRedisManager

func NewRedisManager() *RedisManager

NewRedisManager creates an instance of RedisManager

func (*RedisManager) AddPool

func (r *RedisManager) AddPool(host string, password string)

AddPool adds a redis pool (new redis server connection)

func (*RedisManager) Do

func (r *RedisManager) Do(host, cmd string, a []string) (interface{}, error)

Do executes an arbitrary redis command

func (*RedisManager) Pub

func (r *RedisManager) Pub(host string, channel string, msg string) (interface{}, error)

Pub publishes a message to redis

func (*RedisManager) Sub

func (r *RedisManager) Sub(host string, channel string) chan string

Sub subscribes to a given channel on redis

Jump to

Keyboard shortcuts

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