-
Notifications
You must be signed in to change notification settings - Fork 33
/
builder.go
32 lines (24 loc) · 1.1 KB
/
builder.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
package vertex
import (
"context"
"github.com/DataDog/KubeHound/pkg/config"
"github.com/DataDog/KubeHound/pkg/kubehound/graph/types"
gremlin "github.com/apache/tinkerpop/gremlin-go/v3/driver"
)
// Optional syntactic sugar.
var __ = gremlin.T__
var Column = gremlin.Column
var P = gremlin.P
// Builder interface defines objects used to construct vertices within our graph database through processing data from an ingestion pipeline.
type Builder interface {
// Initialize intializes an edge builder from the application config
Initialize(cfg *config.KubehoundConfig) error
// Label returns the label for the vertex (convention is all camelcase i.e VertexName)
Label() string
// BatchSize returns the batch size of bulk inserts (and threshold for triggering a flush).
BatchSize() int
// Processor transforms an object queued for writing to a format suitable for consumption by the Traversal function.
Processor(context.Context, any) (any, error)
// Traversal returns a graph traversal function that enables creating vertices from an input array of TraversalInput objects.
Traversal() types.VertexTraversal
}