core

package
v0.0.0-...-8ef638e Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2014 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RedisBrain   = newRedisBrain()
	DefaultBrain = RedisBrain
)

Functions

func PrintCommands

func PrintCommands(con *irc.Connection, channel string, commands []string)

func Recall

func Recall(key string) (string, error)

func RecallHash

func RecallHash(hash string, key string) (string, error)

func RecallHashAll

func RecallHashAll(hash string) ([]string, error)

func Remember

func Remember(key string, value interface{}) error

func RememberHash

func RememberHash(hash string, key string, value interface{}) error

func SetDefaultBrain

func SetDefaultBrain(desired Brain)

Types

type Brain

type Brain interface {
	// contains filtered or unexported methods
}

A Brain is capapble of providing persistent storage for a gopherbot

type Extender

type Extender interface {
	Commands() []string
	Process(con *irc.Connection, channel string, user string, args []string)
}

An Extender can be used in gopherbot to provide additional functionality to the core

type Extensions

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

Extensions contains information for extension handling in gopherbot

func NewExtensions

func NewExtensions(con *irc.Connection) *Extensions

NewExtensions creates a new extensions processer that will use the given con to communicate with the IRC room.

func (*Extensions) Register

func (ex *Extensions) Register(command string, handler Extender)

Register adds the mapping of command -> handler to the registry

func (*Extensions) Select

func (ex *Extensions) Select(e *irc.Event)

SelectExtender parses a PRIVMSG IRC event and determines if it is a request for gopherbot. If it is, it looks up the command and invokes the appropriate extender.

Jump to

Keyboard shortcuts

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