forked from choria-io/go-choria
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjson_line.go
30 lines (26 loc) · 950 Bytes
/
json_line.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) 2022, R.I. Pienaar and the Choria Project contributors
//
// SPDX-License-Identifier: Apache-2.0
package inter
import (
"encoding/json"
)
// JsonLineOutput is a line format for json lines output from the cli
type JsonLineOutput struct {
Kind string `json:"k"`
ProtocolReply json.RawMessage `json:"pr,omitempty"`
RPCReply json.RawMessage `json:"rr,omitempty"`
Aggregates json.RawMessage `json:"agg,omitempty"`
Stats json.RawMessage `json:"stat,omitempty"`
Discovered int `json:"count,omitempty"`
DiscoverySeconds float64 `json:"dt,omitempty"`
DiscoveryMethod string `json:"dm,omitempty"`
Error string `json:"err,omitempty"`
}
const (
JsonLineErrorKind = "error"
JsonLineResultKind = "result"
JsonLineSummariesKind = "summaries"
JsonLineStatsKind = "stats"
JsonLineDiscoveredKind = "discovery"
)