1package tasks 2 3type eventEmpty struct{} 4 5// EventFailure contains information on a failure. 6type EventFailure struct { 7 Failure string `json:"failure"` 8} 9 10// EventLog is an event containing a log message. 11type EventLog struct { 12 LogLevel string `json:"log_level"` 13 Message string `json:"message"` 14} 15 16type eventMeasurementGeneric struct { 17 Failure string `json:"failure,omitempty"` 18 Idx int64 `json:"idx"` 19 Input string `json:"input"` 20 JSONStr string `json:"json_str,omitempty"` 21} 22 23type eventStatusEnd struct { 24 DownloadedKB float64 `json:"downloaded_kb"` 25 Failure string `json:"failure"` 26 UploadedKB float64 `json:"uploaded_kb"` 27} 28 29type eventStatusGeoIPLookup struct { 30 ProbeASN string `json:"probe_asn"` 31 ProbeCC string `json:"probe_cc"` 32 ProbeIP string `json:"probe_ip"` 33 ProbeNetworkName string `json:"probe_network_name"` 34} 35 36// EventStatusProgress reports progress information. 37type EventStatusProgress struct { 38 Message string `json:"message"` 39 Percentage float64 `json:"percentage"` 40} 41 42type eventStatusReportGeneric struct { 43 ReportID string `json:"report_id"` 44} 45 46type eventStatusResolverLookup struct { 47 ResolverASN string `json:"resolver_asn"` 48 ResolverIP string `json:"resolver_ip"` 49 ResolverNetworkName string `json:"resolver_network_name"` 50} 51 52// Event is an event emitted by a task. This structure extends the event 53// described by MK v0.10.9 FFI API (https://git.io/Jv4Rv). 54type Event struct { 55 Key string `json:"key"` 56 Value interface{} `json:"value"` 57} 58