Documentation ¶
Index ¶
- type BotInfo
- type Groups
- type ModManager
- func (self *ModManager) Connect() map[string]error
- func (self *ModManager) Disconnect() map[string]error
- func (self *ModManager) ForceDisconnect() map[string][]error
- func (self *ModManager) ForceDisconnectModule(modName string) []error
- func (self *ModManager) Register(mod *module.Module) error
- func (self *ModManager) Running() bool
- type Network
- type ServerInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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