Documentation ¶
Overview ¶
Package mailimp provides helpers for email importers
Index ¶
Constants ¶
This section is empty.
Variables ¶
var PacificTz *time.Location
PacificTz is the time location for America/Los_Angeles
Functions ¶
This section is empty.
Types ¶
type LineMatcher ¶
LineMatcher knows how to match lines
type LineSplitter ¶
type LineSplitter struct {
// contains filtered or unexported fields
}
LineSplitter splits some text into lines. Using this instead of strings.Split() doubled our speed in a lyft benchmark.
func NewLineSplitter ¶
func NewLineSplitter(remainingText string) *LineSplitter
func (*LineSplitter) Next ¶
func (split *LineSplitter) Next() (string, bool)
Next returns the next line and true if there was a line.
type Match ¶
type Match func() string
Match represents a match. When called, it returns the 'rest' of a string (e.g. the suffix when we matched on prefix)
type PrefixMatcher ¶
type PrefixMatcher []string
PrefixMatcher knows how to match line prefixes
func (PrefixMatcher) Match ¶
func (m PrefixMatcher) Match(line string) Match
Match checks to see if a line matches the configured prefixes. If a match is found, we return the rest of the line (the non-matching portion). Otherwise return nil
type SuffixMatcher ¶
type SuffixMatcher []string
SuffixMatcher knows how to match line suffixes
func (SuffixMatcher) Match ¶
func (m SuffixMatcher) Match(line string) Match
Match checks to see if a line matches the configured suffixes. If a match is found, we return the rest of the line (the non-matching portion). Otherwise return nil