...
1
18
19 package types
20
21 import (
22 "net/http"
23 "time"
24 )
25
26 type Load struct {
27
28 SchedulerName string `json:"scheduler_name"`
29
30 FunctionsDeployed uint `json:"functions_deployed"`
31 FunctionsTotalReplicas uint `json:"functions_total_replicas"`
32 FunctionsRunning uint `json:"functions_running"`
33 FunctionsRunningMax uint `json:"functions_running_max"`
34
35 QueueLengthMax uint `json:"queue_max_length"`
36 QueueFill int `json:"queue_fill"`
37 }
38
39 type PeerJobRequest struct {
40
41 ServiceIdRequest uint64 `json:"service_id_request"`
42 ServiceIdTracing string `json:"service_id_tracing"`
43 FunctionName string `json:"function_name"`
44 Hops int `json:"hops"`
45 PeersList []PeersListMember `json:"peers_list"`
46 Payload string `json:"payload"`
47 ContentType string `json:"content_type"`
48 Headers map[string]string `json:"headers"`
49 }
50
51 type PeerJobResponse struct {
52 PeersList []PeersListMember `json:"peers_list"`
53 Body string `json:"body"`
54 StatusCode int `json:"status_code"`
55 }
56
57 type PeersListMember struct {
58 MachineId string `json:"machine_id"`
59 MachineIp string `json:"machine_ip"`
60 Timings Timings `json:"timings"`
61 }
62
63 type TimingsStart struct {
64 ArrivedAt *time.Time `json:"arrived_at,omitempty"`
65 ProbingStartedAt *time.Time `json:"started_probing_at,omitempty"`
66 ProbingEndedAt *time.Time `json:"ended_probing_at,omitempty"`
67 ScheduledAt *time.Time `json:"scheduled_at,omitempty"`
68 }
69
70 type Timings struct {
71 ExecutionTime *float64 `json:"execution_time,omitempty"`
72 TotalTime *float64 `json:"total_time,omitempty"`
73 SchedulingTime *float64 `json:"scheduling_time,omitempty"`
74 ProbingTime *float64 `json:"probing_time,omitempty"`
75 }
76
77 type APIResponse struct {
78 Headers http.Header `json:"headers"`
79 Body []byte `json:"body"`
80 StatusCode int `json:"status_code"`
81 }
82
View as plain text