lib

package
v0.0.0-...-6b8b34a Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2017 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Accum

func Accum(in chan *Email, b int, d string) (chan Emails, error)

Accum ...

func DoGet

func DoGet(u string) (*bytes.Buffer, error)

DoGet ...

func DoPost

func DoPost(u string, r io.Reader) error

DoPost ...

func Generate

func Generate(in []*InputTarget, delay int) chan *Email

Generate ... * enumerates urls from Targets * retrieves the http.Get * send bytes it along to the parse channel

func Parse

func Parse(in chan *Email, c int) chan *Email

Parse ... * takes bytes channel input * normalizes input to text * parses email * sends email to accumulator

func Post

func Post(in chan Emails, u string, d int, c bool) chan int

Post ...

func Trunc

func Trunc(s string) string

Trunc ...

Types

type Email

type Email struct {
	Type    string
	ID      string
	To      []string
	From    string
	Date    time.Time
	Subject string
	Body    string
	Raw     []byte
}

Email ...

func (*Email) Parse

func (e *Email) Parse() error

Parse ...

func (Email) Save

func (e Email) Save(d string) error

Save ...

func (*Email) String

func (e *Email) String() string

type Emails

type Emails []*Email

Emails ...

func (Emails) Post

func (e Emails) Post(u string, delayError int, compress bool) error

Post ...

type FoiaResults

type FoiaResults struct {
	Success    bool
	TotalHits  int
	Results    []Result
	QueryText  string
	FieldMatch string
	Response   string
}

FoiaResults ...

type Input

type Input struct {
	Targets          []*InputTarget
	MiruURL          string `yaml:"miruUrl"`
	OutputDir        string `yaml:"outputDir"`
	DownloadDelayMs  int    `yaml:"downloadDelayMs"`
	AccumBatchSize   int    `yaml:"accumBatchSize"`
	ParserCount      int    `yaml:"parserCount"`
	PostErrorDelayMs int    `yaml:"postErrorDelayMs"`
	PostCompress     bool   `yaml:"postCompress"`
	Debug            bool   `yaml:"debug"`
}

Input ...

func InitInput

func InitInput(r io.Reader) (*Input, error)

InitInput ...

type InputTarget

type InputTarget struct {
	Type    string `yaml:"type"`
	SubType string `yaml:"subType"`
	Start   int    `yaml:"start"`
	End     int    `yaml:"end"`
	Limit   int    `yaml:"limit"`
}

InputTarget ...

func (InputTarget) String

func (i InputTarget) String() string

type Result

type Result struct {
	Subject       string
	DocumentClass string
	PdfLink       string
	OriginalLink  string
	DocDate       int
	PostedDate    int
	From          string
	To            string
	MessageNumber string
	CaseNumber    string
}

Result ...

Jump to

Keyboard shortcuts

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