ultimateq

command module
v0.0.0-...-5398a0e Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2014 License: MIT Imports: 17 Imported by: 0

README

#ultimateq

Build Status Coverage Status

An irc bot written in Go.

ultimateq is a distributed irc bot framework. It allows you to create a bot with a single file (see simple.go for a good example), or to create many extensions that can run independently and hook them up to one bot, or allow many bots to connect to them.

Here's a sample of the bot api for some do-nothing connection to an irc server.


import (
    "github.com/aarondl/ultimateq/bot"
    "os/signal"
    "log"
)

func main() {
    b, err := bot.CreateBot(bot.ConfigureFile("config.yaml"))
    if err != nil {
        log.Fatalln("Error creating bot:", err)
    }
    defer b.Close() // Required to close the database.
    
    end := b.Start()
    
    quit := make(chan os.Signal, 1)
    signal.Notify(quit, os.Interrupt, os.Kill)

    stop := false
    for !stop {
        select {
        case <-quit:
            b.Stop()
            stop = true
        case err, ok := <-end:
            log.Println("Server death:", err)
            stop = !ok
        }
    }    
    log.Println("Shutting down...")
}

Here's a quick sample config.yaml for use with the above:

global:
    nick: Bot
    altnick: Bot_
    username: notabot
    realname: No Bot Here
servers:
    irc.test.com:
        port: 3333
        ssl: true

##Package status

The bot is roughly 60% complete. The internal packages are nearly 100% complete except the outstanding issues that don't involve extensions here: https://github.com/aarondl/ultimateq/issues/

The following major pieces are currently missing:

  • Front ends for people who want an out of the box bot.
  • Extensions.
  • Nice way to create static modules without the boilerplate of loading a config, starting the bot etc.

##Packages

####bot This package ties all the low level plumbing together, using this package's helpers it should be easy to create a bot and deploy him into the dying world of irc.

####irc This package houses the common irc constants and types necessary throughout the bot. It's supposed to remain a small and dependency-less package that all packages can utilize.

####config Config package is used to present a fluent style configuration builder for an irc bot. It also provides some validation, and file reading/writing.

####parse This package deals with parsing irc protocols. It is able to consume irc protocol messages using the Parse method, returning the common irc.Message type from the irc package.

####dispatch Dispatch package is meant to register callbacks and dispatch irc.Messages onto them in an asynchronous method. It also presents many handler types that will be easy to use for bot-writers.

####dispatch/commander Commander package is a much more involved version of the dispatcher. Instead of simply responding to irc raw messages, the commander parses arguments, handles user authentication and privelege checks. It can also do advanced argument handling such as returning a user message's target channels or users from the command.

####inet Implements the actual connection to an irc server, handles buffering, \r\n splitting and appending, and logarithmic write-speed throttling.

####extension This package defines helpers to create an extension for the bot. It should expose a way to connect/allow connections to the bot via TCP or Unix socket. And have simple helpers for some network RPC mechanism.

####data This package holds state information for irc. As well as stores user authentication and access information in a key-value database. (Many thanks to Jan Merci for this great package: https://github.com/cznic/kv)

Documentation

Overview

The ultimateq bot framework.

Directories

Path Synopsis
Package bot implements the top-level package that any non-extension will use to start a bot instance.
Package bot implements the top-level package that any non-extension will use to start a bot instance.
Package config provides several ways to configure an irc bot.
Package config provides several ways to configure an irc bot.
Package data is used to turn irc.IrcMessages into a stateful database.
Package data is used to turn irc.IrcMessages into a stateful database.
Package dispatch is used to dispatch irc messages to event handlers in an concurrent fashion.
Package dispatch is used to dispatch irc messages to event handlers in an concurrent fashion.
commander
Package commander is a more involved dispatcher implementation.
Package commander is a more involved dispatcher implementation.
Package inet handles connecting to an irc server and reading and writing to the connection
Package inet handles connecting to an irc server and reading and writing to the connection
Package irc defines types to be used by most other packages in the ultimateq system.
Package irc defines types to be used by most other packages in the ultimateq system.
Package mocks includes mocks to simplify testing.
Package mocks includes mocks to simplify testing.
Package parse has functions to parse the irc protocol into irc.IrcMessages.
Package parse has functions to parse the irc protocol into irc.IrcMessages.

Jump to

Keyboard shortcuts

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