Documentation ¶
Index ¶
- Variables
- func ForumLogMetadata(data string) map[string][]string
- func IRCCloudPost(line string, tz *time.Location) (models.Post, error)
- func IsParseError(err error) bool
- func MircPost(line string, date time.Time, prev models.Post) (models.Post, error)
- type ParseError
- type ParsedLog
- func ForumLog(data string, tz *time.Location) ([]ParsedLog, error)
- func IRCCloudLog(lines []string, location *time.Location, threshold time.Duration) (*ParsedLog, int, error)
- func IRCCloudLogs(data string, location *time.Location, threshold time.Duration) ([]ParsedLog, error)
- func MircLog(data string, date time.Time, strict bool) (*ParsedLog, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyLog = errors.New("no valid posts found in log")
ErrEmptyLog is returned by ParseLog if there are no (valid) posts in the log.
View Source
var ErrSkip = errors.New("parsers: skip this post")
Functions ¶
func ForumLogMetadata ¶
ForumLogMetadata parses metadata, discards the broken parts, and returns the parsed data as a map (`m`) and the position of the first IRC post (`n`)
func IRCCloudPost ¶
IRCCloudPost parses a post from a mirc-like line. If the previous post is included (it can be empty), it will be used to determine whether midnight has passed.
func IsParseError ¶
Types ¶
type ParseError ¶
func (*ParseError) Error ¶
func (e *ParseError) Error() string
type ParsedLog ¶
A ParsedLog contains the parsed log header and its posts.
func IRCCloudLog ¶
func IRCCloudLog(lines []string, location *time.Location, threshold time.Duration) (*ParsedLog, int, error)
IRCCloudLog parses the log and returns the things that can be gleamed from them.
func IRCCloudLogs ¶
Click to show internal directories.
Click to hide internal directories.