mailimp

package
v0.0.0-...-737f61f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package mailimp provides helpers for email importers

Index

Constants

This section is empty.

Variables

View Source
var PacificTz *time.Location

PacificTz is the time location for America/Los_Angeles

Functions

This section is empty.

Types

type LineMatcher

type LineMatcher interface {
	Match(line string) Match
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL