-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedge.go
More file actions
27 lines (25 loc) · 853 Bytes
/
edge.go
File metadata and controls
27 lines (25 loc) · 853 Bytes
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
package model
// CodeEdge mirrors src/main/java/.../model/CodeEdge.java.
//
// Unlike Java SDN, the Go side stores TargetID as a plain string, not a
// back-reference into a CodeNode. GraphBuilder reattaches edges to nodes
// during the flush phase.
type CodeEdge struct {
ID string `json:"id"`
Kind EdgeKind `json:"kind"`
SourceID string `json:"source_id"`
TargetID string `json:"target_id"`
Confidence Confidence `json:"confidence"`
Source string `json:"source,omitempty"`
Properties map[string]any `json:"properties"`
}
func NewCodeEdge(id string, kind EdgeKind, sourceID, targetID string) *CodeEdge {
return &CodeEdge{
ID: id,
Kind: kind,
SourceID: sourceID,
TargetID: targetID,
Confidence: ConfidenceLexical,
Properties: map[string]any{},
}
}