Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAlreadyExists = errors.New("document already exists")
Functions ¶
Types ¶
type Config ¶
type Config struct { Modules map[string]*modules.ModuleConfig Inputs InputsConfig Queues QueuesConfig Scrapers ScrapersConfig Processors ProcessorsConfig Outputs OutputsConfig }
type Document ¶
type Document struct { ID string Title string User string `json:",omitempty"` Size int URL string Content []byte CreatedAt time.Time ExpireAt time.Time Score int Processed []ProcessedData `json:",omitempty"` // Internally managed // InputModuleName string }
func NewDocumentFromJSON ¶
type InputModule ¶
type InputsConfig ¶
type InputsConfig struct {
Modules []string
}
type OutputModule ¶
type OutputModule interface { Configure(*modules.ModuleConfig) error Send(*Document) error }
type OutputsConfig ¶
type ProcessedData ¶
type ProcessedData struct { Module string json.RawMessage }
type ProcessorModule ¶
type ProcessorModule interface { Configure(*modules.ModuleConfig) error Process(*Document) error }
type ProcessorsConfig ¶
type QueueModule ¶
type QueueModule interface { Configure(moduleConfig *modules.ModuleConfig) error AddDocument(queue string, d *Document, cacheTTL time.Duration) error GetDocument(queue string, ttl time.Duration) (string, *Document, func(time.Duration) error, error) ReleaseDocument(queue string, d *Document) error DeleteDocument(queue string, d *Document) error Bookkeep(queues []string) }
type QueuesConfig ¶
type QueuesConfig struct {
Module string
}
type ScrapersConfig ¶
Click to show internal directories.
Click to hide internal directories.