elasticsink

package
v0.0.0-...-31048c2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2014 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MM3_SEED = 538273
	ES_INDEX = "nzb"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ElasticSink

type ElasticSink struct {
	// contains filtered or unexported fields
}

func NewElasticSink

func NewElasticSink(params ElasticSinkParams) (*ElasticSink, error)

func (*ElasticSink) Accept

func (es *ElasticSink) Accept(articles []newsrover.Article)

func (*ElasticSink) Fail

func (es *ElasticSink) Fail(article newsrover.Article)

func (*ElasticSink) FailAll

func (es *ElasticSink) FailAll(articles []interface{})

func (*ElasticSink) Name

func (es *ElasticSink) Name() string

func (*ElasticSink) Serve

func (es *ElasticSink) Serve()

func (*ElasticSink) SetLogger

func (es *ElasticSink) SetLogger(logger *log.Logger)

func (*ElasticSink) Stop

func (es *ElasticSink) Stop()

type ElasticSinkParams

type ElasticSinkParams struct {
	Workers int       `json:"workers"`
	FailLog io.Writer `json:"-"`

	ElasticHost string `json:"host"`
	ElasticPort int    `json:"port"`
}

type File

type File struct {
	Id      string    `json:"_id"`
	Poster  string    `json:"poster"`
	Subject string    `json:"subject"`
	Date    time.Time `json:"date"`
	Group   []string  `json:"group"`

	Length   int   `json:"length"`
	Complete int   `json:"complete"`
	Size     int64 `json:"size"`

	Filename string     `json:"filename"`
	Segments []*Segment `json:"segments"`

	ParentId string `json:"-"`
}

type Segment

type Segment struct {
	Group           string    `json:"group"`
	Subject         string    `json:"subject,omitempty"`
	Filename        string    `json:"filename"`
	Poster          string    `json:"poster"`
	Date            time.Time `json:"date"`
	ServerArticleId int64     `json:"server_article_id"`
	MessageId       string    `json:"message_id"`
	Bytes           int64     `json:"bytes"`
	Part            int       `json:"part"`
	Length          int       `json:"length"`
	Added           time.Time `json:"added"`
}

type Upload

type Upload struct {
	Id         string         `json:"_id"`
	Poster     string         `json:"poster"`
	Subject    string         `json:"subject"`
	Date       time.Time      `json:"date"`
	Group      []string       `json:"group"`
	Dmca       bool           `json:"dmca"`
	Length     int            `json:"length"`
	Complete   int            `json:"complete"`
	Completion float64        `json:"completion"`
	Size       int64          `json:"size"`
	Segments   []*Segment     `json:"segments"`
	Types      map[string]int `json:"types"`
}

Jump to

Keyboard shortcuts

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