Documentation ¶
Index ¶
Constants ¶
View Source
const ( TaskTypeRandom = "random" TaskTypePrice = "price" )
task types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct { ID int Hash string Source string Task string // task code (from external system) Data ItemData CreateTime time.Time }
Item in an piece of data collected by a task during one run
type ItemData ¶
type ItemData struct { // fot task type random Value int `json:"value"` // for task type price Price float64 `json:"price,omitempty"` PriceMax float64 `json:"priceMax,omitempty"` PriceMin float64 `json:"priceMin,omitempty"` Product string `json:"product,omitempty"` Seller string `json:"seller,omitempty"` // for task type word Word string `json:"word,omitempty"` Rate float64 `json:"rate,omitempty"` // common Platform string `json:"platform,omitempty"` }
ItemData holds item payload
type SystemSymmary ¶
type SystemSymmary struct { ID int Users int Tasks int ActiveTasks int Items int AvgItemsPerTask float64 CreateTime time.Time }
SystemSymmary holds system state gathered by the relevant job
type Task ¶
type Task struct { ID int // id is passed to domain model for simplicity Code string // unique task code for external systems User string // username Type string // task type code Slug string Title string Description string Active bool Items []Item Meta TaskMeta Params TaskParams }
Task represents data backend task
type TaskParams ¶
type TaskParams struct { Random TaskParamsRandom `json:"random,omitempty"` Price TaskParamsPrice `json:"price,omitempty"` }
TaskParams holds task running params provided by user
type TaskParamsRandom ¶
TaskParamsRandom hold params from 'random' task
Click to show internal directories.
Click to hide internal directories.