Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateRequest ¶
type CreateRequest struct { URL string `json:"url"` XPATH string `json:"xpath"` Name string `json:"name"` ExpectedPrice string `json:"expectedPrice"` Options Options `json:"options,omitempty"` }
CreateRequest defines the contract to add an entry
type CreateResponse ¶
type CreateResponse struct { OK bool `json:"ok"` Message string `json:"message"` Key *datastore.Key `json:"key,omitempty"` }
CreateResponse returns whether create is successful
type Entity ¶
type Entity struct { K *datastore.Key `json:",omitempty" datastore:"__key__"` Options Options `json:",omitempty" datastore:",noindex"` URL string `json:",omitempty" datastore:",noindex"` XPATH string `json:",omitempty" datastore:",noindex"` Name string `json:",omitempty"` NextCheck time.Time `json:",omitempty"` History []DataPoint `json:",omitempty" datastore:",noindex"` }
Entity is the data structure for datastore entry
type Options ¶
type Options struct { User string `json:"user"` CheckFreq int16 `json:"checkFreq"` // in minutes AlertType string `json:"alertType"` Threshold float32 `json:"threshold"` MaxRecords int16 `json:"maxRecords"` UseChrome bool `json:"useChrome"` }
Options is the options for an entry
type ReadOrDelRequest ¶
ReadOrDelRequest defines the contract to read/delete an entry
type ReadOrDelResponse ¶
type ReadOrDelResponse struct { OK bool `json:"ok"` Message string `json:"message"` Entity *Entity `json:"entity,omitempty"` }
ReadOrDelResponse returns whether read or del is successful
type UpdateRequest ¶
type UpdateRequest struct { URL string `json:"url"` XPATH string `json:"xpath"` Name string `json:"name"` Key *datastore.Key `json:"key"` UseChrome *bool `json:"useChrome,omitempty"` Options *Options `json:"options,omitempty"` }
UpdateRequest defines the contract to update an entry
Click to show internal directories.
Click to hide internal directories.