irclib

package module
v0.0.0-...-a977c90 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2014 License: MIT Imports: 13 Imported by: 2

README

irclib

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BotInfo

type BotInfo struct {
	Chans  []string
	Access access
}

type Groups

type Groups struct {
	Users []string
}

type ModManager

type ModManager struct {
	Conn   *irc.Conn // IRC Connection
	Config *BotInfo  // Bot config

	Quit chan bool // Quit chan to block until a successful disconnect or force disconnect
	// contains filtered or unexported fields
}

func New

func New(fileName string) (*ModManager, error)

Returns a new ModManager configured with a TOML file.

func NewManager

func NewManager(serverInfo *ServerInfo) (*ModManager, error)

Create a new ModManager from a ServerInfo config

func (*ModManager) Connect

func (self *ModManager) Connect() map[string]error

Connect to IRC. If a registered module's PreStart() returns an error it does not attempt to call Start(). A map of module names to error is returned if there were any errors or nil if none. Errors are logged to the core module. If there are errors in "core" from the map then Connect() failed

func (*ModManager) Disconnect

func (self *ModManager) Disconnect() map[string]error

Disconnects and cleans up. Returns a map of module names to errors if module.Exit() returned an error. Errors returned by module.Exit() are logged to core. If there are any errors when calling module.Exit() ModManager will not finish cleanup

func (*ModManager) ForceDisconnect

func (self *ModManager) ForceDisconnect() map[string][]error

Force Disconnect all modules, returning a map of modules to a list or errors

func (*ModManager) ForceDisconnectModule

func (self *ModManager) ForceDisconnectModule(modName string) []error

Force disconnect a module aggregating all errors and returning that list

func (*ModManager) Register

func (self *ModManager) Register(mod *module.Module) error

Registers a unique module; "core" is a reserved module name. If a module with the same name is already registered an error is returned

func (*ModManager) Running

func (self *ModManager) Running() bool

type Network

type Network struct {
	SSL      bool
	Server   string
	Port     int
	PingFreq int
	SplitLen int
	Flood    bool
	Tracking bool
}

type ServerInfo

type ServerInfo struct {
	Nick, Ident, Name string
	Pass              string
	Channels          []string
	Version           string
	QuitMessage       string

	Network Network
	Access  map[string]Groups
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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