-
Notifications
You must be signed in to change notification settings - Fork 17
/
fdg.go
47 lines (39 loc) · 1.15 KB
/
fdg.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*************************************************************************
* Copyright 2021 Gravwell, Inc. All rights reserved.
* Contact: <legal@gravwell.io>
*
* This software may be modified and distributed under the terms of the
* BSD 2-clause license. See the LICENSE file for details.
**************************************************************************/
package types
const (
// request IDs
FDG_REQ_GET_ENTRIES uint32 = 0x02000002
FDG_REQ_STREAMING uint32 = 0x02000005
// response IDs
FDG_RESP_GET_ENTRIES uint32 = 0x02000002
FDG_RESP_STREAMING uint32 = 0x02000005
)
type FdgRequest struct {
BaseRequest
}
type FdgSet struct {
Nodes []Node `json:"nodes"`
Edges []Edge `json:"links"`
Groups []string `json:"groups"`
}
type Node struct {
Name string `json:"name"`
Group int `json:"group"`
}
type Edge struct {
Value int64 `json:"value"`
// Source and Destination nodes for an edge are represented by an index
// into the parent node set
Src int `json:"source"` // index into the source node list
Dst int `json:"target"` // index into the destination node list
}
type FdgResponse struct {
BaseResponse
Entries FdgSet
}