package store import ( "encoding/json" "time" ) // StartEvent and CompleteEvent are the receiver-side decodings of the // webhook payloads posted by the main app. Field names and JSON tags must // stay in sync with webhookStartEvent/webhookCompleteEvent in // web/api/webhook.go; a compatibility test in web/api enforces this. // StartEvent mirrors web/api webhookStartEvent. type StartEvent struct { Event string `json:"event"` ID string `json:"id"` Domain string `json:"domain"` QueryType string `json:"query_type"` AllRoots bool `json:"all_roots"` ClientIP string `json:"client_ip"` StartedAt time.Time `json:"started_at"` } // CompleteEvent mirrors web/api webhookCompleteEvent. Summary is kept as // raw JSON: the receiver stores it verbatim and never interprets it. type CompleteEvent struct { Event string `json:"event"` ID string `json:"id"` Domain string `json:"domain"` QueryType string `json:"query_type"` ClientIP string `json:"client_ip"` StartedAt time.Time `json:"started_at"` DoneAt time.Time `json:"done_at"` DurationMS int64 `json:"duration_ms"` Status string `json:"status"` Error string `json:"error,omitempty"` ResultCount int `json:"result_count"` Summary json.RawMessage `json:"summary"` }