Documentation
¶
Index ¶
Constants ¶
const ( ActionKill = "KILL" ActionConnected = "CONNECTED" ActionDisconnected = "DISCONNECTED" ActionChat = "CHAT" ActionMatchStart = "MATCH START" ActionMatchEnded = "MATCH ENDED" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogLoop ¶
type LogLoop struct {
// contains filtered or unexported fields
}
func NewLogLoop ¶
func NewLogLoop(opts LogLoopOptions) *LogLoop
NewLogLoop instantiates a log loop, which periodically requests logs from the game server, parses them and exposes them in batches to the caller.
Not all events are currently parsed, however, each log line is added to the batches at least with the raw message.
func (*LogLoop) Run ¶
Run starts polling logs from the server. Each time at least one new log line is discovered, the passed function f is called with an undefined number of log lines as it's only argument. Whenever f is called, at least one log line will be in the log line slice.
The return value of f is a boolean indicating if polling for new log lines should continue. Returning true will stop this run with no error. Polling can be restarted by calling Run again. Returning false will result in Run to continue polling for new log lines.
type LogLoopOptions ¶
type MatchResult ¶
type StructuredLogLine ¶
type StructuredLogLine struct { Raw string Timestamp time.Time Action string Actor Player Subject Player Weapon string Message string Result *MatchResult Rest string }
func ParseLogLine ¶
func ParseLogLine(line string) (StructuredLogLine, error)
func (*StructuredLogLine) String ¶
func (l *StructuredLogLine) String() string