Documentation ¶
Overview ¶
2019 Daniel Oaks <daniel@danieloaks.net> released under the MIT license
2019 Daniel Oaks <daniel@danieloaks.net> released under the MIT license
2019 Daniel Oaks <daniel@danieloaks.net> released under the MIT license
2019 Daniel Oaks <daniel@danieloaks.net> released under the MIT license
Index ¶
Constants ¶
const ( // ResultIRCMessage is a regular IRC message. ResultIRCMessage ScriptResultLineType = iota // ResultDisconnected is a client being disconnected from the server. ResultDisconnected = iota // ResultDisconnectedExpected is a client being disconnecting from the server (which we expect). ResultDisconnectedExpected = iota // ResultActionSync is a note that an 'action' has just been processed, used to sync // results between servers. ResultActionSync = iota )
Variables ¶
var ( // ErrorDisconnected indicates that this socket is disconnected. ErrorDisconnected = errors.New("Socket is disconnected") )
Functions ¶
func HTMLFromResults ¶
func HTMLFromResults(script *Script, serverConfigs map[string]ServerConfig, scriptResults map[string]*ScriptResults) string
HTMLFromResults takes a set of results and outputs an HTML representation of those results.
Types ¶
type Config ¶
type Config struct { Output OutputConfig Servers map[string]ServerConfig }
func LoadConfig ¶
func LoadConfigFromFile ¶
type OutputConfig ¶
type OutputConfig struct{}
type Script ¶
type Script struct { // metadata Name string ShortDescription string // actual data Clients map[string]bool Actions []ScriptAction }
Script is a series of actions to perform on a server.
func ReadScript ¶
ReadScript creates a Script from a given script file.
type ScriptAction ¶
type ScriptAction struct { // client this action applies to Client string // line that this client should send LineToSend string // list of messages to wait for after sending the given line (if one is given) WaitAfterFor map[string]bool // special action type SpecialActionType SpecialActionType }
ScriptAction is an action to perform on the server, with the given client.
func NewScriptAction ¶
func NewScriptAction() ScriptAction
NewScriptAction returns a new ScriptAction.
type ScriptResultLine ¶
type ScriptResultLine struct { // required Type ScriptResultLineType Client string // optional RawLine string }
ScriptResultLine is a return IRC line or other action from the server.
type ScriptResultLineType ¶
type ScriptResultLineType int
ScriptResultLineType is a type of result line from running a script.
type ScriptResults ¶
type ScriptResults struct { Clients map[string]bool Lines []ScriptResultLine }
ScriptResults is the output from running a Script on a server.
func NewScriptResults ¶
func NewScriptResults() *ScriptResults
NewScriptResults returns a new ScriptResults
type ServerConfig ¶
type Socket ¶
type Socket struct {
// contains filtered or unexported fields
}
Socket appropriately buffers IRC lines.
func ConnectSocket ¶
ConnectSocket connects to the given host/port and starts our receivers if appropriate.
func MakeSocket ¶
MakeSocket makes a socket from the given connection.
func (*Socket) Disconnect ¶
func (s *Socket) Disconnect()
Disconnect severs our connection to the server.
type SpecialActionType ¶
type SpecialActionType int
SpecialActionType is a special type of script action.
const ( // NoSpecialAction means no special action is performed. NoSpecialAction SpecialActionType = iota // WaitForDisconnect means process messages until we're disconnected. WaitForDisconnect = iota )