awg

package module
Version: v0.0.0-...-e218727 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2018 License: ISC Imports: 4 Imported by: 0

README

awg

adidis worker framework in Go

Documentation

Overview

Package awg provides "a worker in go"

awg is designed to be compatible with github.com/foxbot/adidis, a distributed discord sharder. It should work with any sharder that sends JSON-encoded Discord events over a Redis gateway keyed with `exchange:events` - though this can pretty easily be adapted to work in your environment.

sub-packages are provided to help make writing a fully-fledged bot with this worker easier.

Index

Constants

View Source
const (
	// KeyExchange is the key for the events exchange
	KeyExchange = "exchange:events"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IWorker

type IWorker interface {
	Discord() *wumpus.Discord
	Messages() <-chan wumpus.Message
}

IWorker defines an interface for a worker

type Worker

type Worker struct {
	ID string
	// contains filtered or unexported fields
}

Worker will pull and parse data from Redis

func NewWorker

func NewWorker(id, redisAddr, discordAddr string) (*Worker, error)

NewWorker creates a new worker at the given redis address

func (*Worker) Close

func (worker *Worker) Close()

Close closes the worker

func (*Worker) Discord

func (worker *Worker) Discord() *wumpus.Discord

Discord returns the worker's discord access

func (*Worker) Messages

func (worker *Worker) Messages() <-chan wumpus.Message

Messages returns a readonly chan of incoming messages

func (*Worker) Run

func (worker *Worker) Run() <-chan error

Run runs the worker

Directories

Path Synopsis
Package bot provides an example bot with example commands using this worker
Package bot provides an example bot with example commands using this worker
cmd
Package commands provides a basic commands manager for a bot to use View the example bot under github.com/foxbot/awg/bot to see its intended use.
Package commands provides a basic commands manager for a bot to use View the example bot under github.com/foxbot/awg/bot to see its intended use.
Package wumpus provides lightweight wrappers over Discord's REST and Gateway APIs.
Package wumpus provides lightweight wrappers over Discord's REST and Gateway APIs.

Jump to

Keyboard shortcuts

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