traversal

package
v0.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 20 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSocketIndexer added in v0.17.0

func NewSocketIndexer(g *graph.Graph) *graph.Indexer

NewSocketIndexer returns a new socket graph indexer

func TopologyGremlinQuery

func TopologyGremlinQuery(g *graph.Graph, query string) (traversal.GraphTraversalStep, error)

TopologyGremlinQuery run a gremlin query on the graph g without any extension

Types

type AggregatesGremlinTraversalStep

type AggregatesGremlinTraversalStep struct {
	traversal.GremlinTraversalContext
}

AggregatesGremlinTraversalStep aggregates step

func (*AggregatesGremlinTraversalStep) Context

Context Aggregates step

func (*AggregatesGremlinTraversalStep) Exec

Exec Aggregates step

func (*AggregatesGremlinTraversalStep) Reduce

Reduce Aggregates step

type AscendantsGremlinTraversalStep added in v0.28.0

type AscendantsGremlinTraversalStep struct {
	// contains filtered or unexported fields
}

AscendantsGremlinTraversalStep rawpackets step

func (*AscendantsGremlinTraversalStep) Context added in v0.28.0

Context Ascendants step

func (*AscendantsGremlinTraversalStep) Exec added in v0.28.0

Exec Ascendants step

func (*AscendantsGremlinTraversalStep) Reduce added in v0.28.0

Reduce Ascendants step

type AscendantsTraversalExtension added in v0.28.0

type AscendantsTraversalExtension struct {
	AscendantsToken traversal.Token
}

AscendantsTraversalExtension describes a new extension to enhance the topology

func NewAscendantsTraversalExtension added in v0.28.0

func NewAscendantsTraversalExtension() *AscendantsTraversalExtension

NewAscendantsTraversalExtension returns a new graph traversal extension

func (*AscendantsTraversalExtension) ParseStep added in v0.28.0

ParseStep parses ascendants step

func (*AscendantsTraversalExtension) ScanIdent added in v0.28.0

ScanIdent returns an associated graph token

type BpfGremlinTraversalStep

type BpfGremlinTraversalStep struct {
	traversal.GremlinTraversalContext
}

BpfGremlinTraversalStep step

func (*BpfGremlinTraversalStep) Context

Context of BPF step

func (*BpfGremlinTraversalStep) Exec

Exec BPF step

func (*BpfGremlinTraversalStep) Reduce

Reduce BPF step

type CaptureNodeGremlinTraversalStep

type CaptureNodeGremlinTraversalStep struct {
	traversal.GremlinTraversalContext
}

CaptureNodeGremlinTraversalStep capture step

func (*CaptureNodeGremlinTraversalStep) Context

Context step

func (*CaptureNodeGremlinTraversalStep) Exec

Exec Capture step

func (*CaptureNodeGremlinTraversalStep) Reduce

Reduce Capture step

type DescendantsGremlinTraversalStep added in v0.19.0

type DescendantsGremlinTraversalStep struct {
	// contains filtered or unexported fields
}

DescendantsGremlinTraversalStep rawpackets step

func (*DescendantsGremlinTraversalStep) Context added in v0.19.0

Context Descendants step

func (*DescendantsGremlinTraversalStep) Exec added in v0.19.0

Exec Descendants step

func (*DescendantsGremlinTraversalStep) Reduce added in v0.19.0

Reduce Descendants step

type DescendantsTraversalExtension added in v0.19.0

type DescendantsTraversalExtension struct {
	DescendantsToken traversal.Token
}

DescendantsTraversalExtension describes a new extension to enhance the topology

func NewDescendantsTraversalExtension added in v0.19.0

func NewDescendantsTraversalExtension() *DescendantsTraversalExtension

NewDescendantsTraversalExtension returns a new graph traversal extension

func (*DescendantsTraversalExtension) ParseStep added in v0.19.0

ParseStep parses descendants step

func (*DescendantsTraversalExtension) ScanIdent added in v0.19.0

ScanIdent returns an associated graph token

type FlowGremlinTraversalStep

type FlowGremlinTraversalStep struct {
	TableClient flow.TableClient
	Storage     storage.Storage
	// contains filtered or unexported fields
}

FlowGremlinTraversalStep a flow Gremlin language step

func (*FlowGremlinTraversalStep) Context

Context flow step

func (*FlowGremlinTraversalStep) Exec

Exec flow step

func (*FlowGremlinTraversalStep) Reduce

Reduce flow step

type FlowTraversalExtension

type FlowTraversalExtension struct {
	FlowToken        traversal.Token
	HopsToken        traversal.Token
	NodesToken       traversal.Token
	CaptureNodeToken traversal.Token
	AggregatesToken  traversal.Token
	GroupToken       traversal.Token
	BpfToken         traversal.Token
	TableClient      flow.TableClient
	Storage          storage.Storage
}

FlowTraversalExtension describes flows in a graph Gremlin language extension

func NewFlowTraversalExtension

func NewFlowTraversalExtension(client flow.TableClient, storage storage.Storage) *FlowTraversalExtension

NewFlowTraversalExtension creates a new flow traversal extension for Gremlin parser

func (*FlowTraversalExtension) ParseStep

ParseStep creates steps from token

func (*FlowTraversalExtension) ScanIdent

func (e *FlowTraversalExtension) ScanIdent(s string) (traversal.Token, bool)

ScanIdent tokenize the step

type FlowTraversalStep

type FlowTraversalStep struct {
	GraphTraversal *traversal.GraphTraversal
	Storage        storage.Storage
	// contains filtered or unexported fields
}

FlowTraversalStep a flow step linked to a storage

func (*FlowTraversalStep) Both

func (f *FlowTraversalStep) Both(ctx traversal.StepContext, s ...interface{}) *traversal.GraphTraversalV

Both returns A and B nodes

func (*FlowTraversalStep) CaptureNode

func (f *FlowTraversalStep) CaptureNode(ctx traversal.StepContext, s ...interface{}) *traversal.GraphTraversalV

CaptureNode step

func (*FlowTraversalStep) Count

func (f *FlowTraversalStep) Count(ctx traversal.StepContext, s ...interface{}) *traversal.GraphTraversalValue

Count step

func (*FlowTraversalStep) Dedup

func (f *FlowTraversalStep) Dedup(ctx traversal.StepContext, keys ...interface{}) *FlowTraversalStep

Dedup deduplicate step

func (*FlowTraversalStep) Error

func (f *FlowTraversalStep) Error() error

Error returns traversal error

func (*FlowTraversalStep) FlowMetrics

FlowMetrics returns flow metric counters

func (*FlowTraversalStep) Group added in v0.26.0

func (f *FlowTraversalStep) Group(ctx traversal.StepContext, s ...interface{}) *GroupTraversalStep

Group returns flows gourped by TrackingID (by default)

func (*FlowTraversalStep) Has

func (f *FlowTraversalStep) Has(ctx traversal.StepContext, s ...interface{}) *FlowTraversalStep

Has step

func (*FlowTraversalStep) HasEither added in v0.21.0

func (f *FlowTraversalStep) HasEither(ctx traversal.StepContext, s ...interface{}) *FlowTraversalStep

HasEither step

func (*FlowTraversalStep) Hops

func (f *FlowTraversalStep) Hops(ctx traversal.StepContext, s ...interface{}) *traversal.GraphTraversalV

Hops returns all the capture nodes where the flow was seen

func (*FlowTraversalStep) In

func (f *FlowTraversalStep) In(ctx traversal.StepContext, s ...interface{}) *traversal.GraphTraversalV

In returns the A node

func (*FlowTraversalStep) MarshalJSON

func (f *FlowTraversalStep) MarshalJSON() ([]byte, error)

MarshalJSON serialize in JSON

func (*FlowTraversalStep) Nodes

func (f *FlowTraversalStep) Nodes(ctx traversal.StepContext, s ...interface{}) *traversal.GraphTraversalV

Nodes returns A, B and the capture nodes

func (*FlowTraversalStep) Out

func (f *FlowTraversalStep) Out(ctx traversal.StepContext, s ...interface{}) *traversal.GraphTraversalV

Out returns the B node

func (*FlowTraversalStep) PropertyKeys

func (f *FlowTraversalStep) PropertyKeys(ctx traversal.StepContext, keys ...interface{}) *traversal.GraphTraversalValue

PropertyKeys returns flow fields

func (*FlowTraversalStep) PropertyValues

func (f *FlowTraversalStep) PropertyValues(ctx traversal.StepContext, keys ...interface{}) *traversal.GraphTraversalValue

PropertyValues returns a flow field value

func (*FlowTraversalStep) RawPackets

RawPackets searches for RawPacket based on previous flow filter from either agents or datastore.

func (*FlowTraversalStep) Sockets added in v0.17.0

func (f *FlowTraversalStep) Sockets(ctx traversal.StepContext, s ...interface{}) *SocketsTraversalStep

Sockets returns the sockets at both sides of the specified flows

func (*FlowTraversalStep) Sort

func (f *FlowTraversalStep) Sort(ctx traversal.StepContext, keys ...interface{}) *FlowTraversalStep

Sort step

func (*FlowTraversalStep) Sum

func (f *FlowTraversalStep) Sum(ctx traversal.StepContext, keys ...interface{}) *traversal.GraphTraversalValue

Sum aggregates integer values mapped by 'key' cross flows

func (*FlowTraversalStep) Values

func (f *FlowTraversalStep) Values() []interface{}

Values returns list of flows

type GroupGremlinTraversalStep added in v0.26.0

type GroupGremlinTraversalStep struct {
	traversal.GremlinTraversalContext
}

GroupGremlinTraversalStep group flows step

func (*GroupGremlinTraversalStep) Context added in v0.26.0

Context Group step

func (*GroupGremlinTraversalStep) Exec added in v0.26.0

Exec Group step

func (*GroupGremlinTraversalStep) Reduce added in v0.26.0

Reduce Group step

type GroupTraversalExtension added in v0.26.0

type GroupTraversalExtension struct {
	MoreThanToken traversal.Token
}

GroupTraversalExtension describes a new extension to enhance the topology

func NewGroupTraversalExtension added in v0.26.0

func NewGroupTraversalExtension() *GroupTraversalExtension

NewGroupTraversalExtension returns a new graph traversal extension

func (*GroupTraversalExtension) ParseStep added in v0.26.0

ParseStep parse metrics step

func (*GroupTraversalExtension) ScanIdent added in v0.26.0

func (e *GroupTraversalExtension) ScanIdent(s string) (traversal.Token, bool)

ScanIdent returns an associated graph token

type GroupTraversalStep added in v0.26.0

type GroupTraversalStep struct {
	GraphTraversal *traversal.GraphTraversal
	// contains filtered or unexported fields
}

GroupTraversalStep group flows step

func (*GroupTraversalStep) Error added in v0.26.0

func (ts *GroupTraversalStep) Error() error

Error returns traversal error

func (*GroupTraversalStep) MarshalJSON added in v0.26.0

func (ts *GroupTraversalStep) MarshalJSON() ([]byte, error)

MarshalJSON serialize in JSON

func (*GroupTraversalStep) MoreThan added in v0.26.0

func (ts *GroupTraversalStep) MoreThan(ctx traversal.StepContext, s ...interface{}) *GroupTraversalStep

MoreThan returns only group that contain more than one flow

func (*GroupTraversalStep) Values added in v0.26.0

func (ts *GroupTraversalStep) Values() []interface{}

Values returns list of raw packets

type HopsGremlinTraversalStep

type HopsGremlinTraversalStep struct {
	traversal.GremlinTraversalContext
}

HopsGremlinTraversalStep hops step

func (*HopsGremlinTraversalStep) Context

Context hops step

func (*HopsGremlinTraversalStep) Exec

Exec hops step

func (*HopsGremlinTraversalStep) Reduce

Reduce hops step

type MetricsGremlinTraversalStep

type MetricsGremlinTraversalStep struct {
	traversal.GremlinTraversalContext
	// contains filtered or unexported fields
}

MetricsGremlinTraversalStep describes the Metrics gremlin traversal step

func (*MetricsGremlinTraversalStep) Context

Context metrics step

func (*MetricsGremlinTraversalStep) Exec

Exec executes the metrics step

func (*MetricsGremlinTraversalStep) Reduce

Reduce metrics step

type MetricsTraversalExtension

type MetricsTraversalExtension struct {
	MetricsToken traversal.Token
}

MetricsTraversalExtension describes a new extension to enhance the topology

func NewMetricsTraversalExtension

func NewMetricsTraversalExtension() *MetricsTraversalExtension

NewMetricsTraversalExtension returns a new graph traversal extension

func (*MetricsTraversalExtension) ParseStep

ParseStep parse metrics step

func (*MetricsTraversalExtension) ScanIdent

ScanIdent returns an associated graph token

type MetricsTraversalStep

type MetricsTraversalStep struct {
	GraphTraversal *traversal.GraphTraversal
	// contains filtered or unexported fields
}

MetricsTraversalStep traversal step metric interface counters

func InterfaceMetrics

InterfaceMetrics returns a Metrics step from interface metric metadata

func NewMetricsTraversalStep

func NewMetricsTraversalStep(gt *traversal.GraphTraversal, metrics map[string][]common.Metric) *MetricsTraversalStep

NewMetricsTraversalStep creates a new traversal metric step

func NewMetricsTraversalStepFromError added in v0.17.0

func NewMetricsTraversalStepFromError(err error) *MetricsTraversalStep

NewMetricsTraversalStepFromError creates a new traversal metric step

func (*MetricsTraversalStep) Aggregates

func (m *MetricsTraversalStep) Aggregates(ctx traversal.StepContext, s ...interface{}) *MetricsTraversalStep

Aggregates merges multiple metrics array into one by summing overlapping metrics. It returns a unique array will all the aggregated metrics.

func (*MetricsTraversalStep) Count

func (m *MetricsTraversalStep) Count(ctx traversal.StepContext, s ...interface{}) *traversal.GraphTraversalValue

Count step

func (*MetricsTraversalStep) Error

func (m *MetricsTraversalStep) Error() error

Error returns error present at this step

func (*MetricsTraversalStep) MarshalJSON

func (m *MetricsTraversalStep) MarshalJSON() ([]byte, error)

MarshalJSON serialize in JSON

func (*MetricsTraversalStep) PropertyKeys added in v0.19.0

func (m *MetricsTraversalStep) PropertyKeys(ctx traversal.StepContext, keys ...interface{}) *traversal.GraphTraversalValue

PropertyKeys returns metric fields

func (*MetricsTraversalStep) Sum

func (m *MetricsTraversalStep) Sum(ctx traversal.StepContext, keys ...interface{}) *traversal.GraphTraversalValue

Sum aggregates integer values mapped by 'key' cross flows

func (*MetricsTraversalStep) Values

func (m *MetricsTraversalStep) Values() []interface{}

Values returns the graph metric values

type MoreThanGremlinTraversalStep added in v0.26.0

type MoreThanGremlinTraversalStep struct {
	traversal.GremlinTraversalContext
}

MoreThanGremlinTraversalStep group flows step

func (*MoreThanGremlinTraversalStep) Context added in v0.26.0

Context MoreThan step

func (*MoreThanGremlinTraversalStep) Exec added in v0.26.0

Exec MoreThan step

func (*MoreThanGremlinTraversalStep) Reduce added in v0.26.0

Reduce MoreThan step

type NextHopGremlinTraversalStep added in v0.21.0

type NextHopGremlinTraversalStep struct {
	// contains filtered or unexported fields
}

NextHopGremlinTraversalStep nexthops step

func (*NextHopGremlinTraversalStep) Context added in v0.21.0

Context NextHop step

func (*NextHopGremlinTraversalStep) Exec added in v0.21.0

Exec NextHop step

func (*NextHopGremlinTraversalStep) Reduce added in v0.21.0

Reduce nexthop step

type NextHopTraversalExtension added in v0.21.0

type NextHopTraversalExtension struct {
	NextHopToken traversal.Token
}

NextHopTraversalExtension describes a new extension to enhance the topology

func NewNextHopTraversalExtension added in v0.21.0

func NewNextHopTraversalExtension() *NextHopTraversalExtension

NewNextHopTraversalExtension returns a new graph traversal extension

func (*NextHopTraversalExtension) ParseStep added in v0.21.0

ParseStep parses nexthops step

func (*NextHopTraversalExtension) ScanIdent added in v0.21.0

ScanIdent returns an associated graph token

type NextHopTraversalStep added in v0.21.0

type NextHopTraversalStep struct {
	GraphTraversal *traversal.GraphTraversal
	// contains filtered or unexported fields
}

NextHopTraversalStep traversal step of nexthop

func NewNextHopTraversalStep added in v0.21.0

func NewNextHopTraversalStep(gt *traversal.GraphTraversal, value map[string]*topology.NextHop) *NextHopTraversalStep

NewNextHopTraversalStep creates a new traversal nexthop step

func NewNextHopTraversalStepFromError added in v0.21.0

func NewNextHopTraversalStepFromError(err ...error) *NextHopTraversalStep

NewNextHopTraversalStepFromError creates a new traversal nexthop step

func (*NextHopTraversalStep) Error added in v0.21.0

func (t *NextHopTraversalStep) Error() error

func (*NextHopTraversalStep) MarshalJSON added in v0.21.0

func (t *NextHopTraversalStep) MarshalJSON() ([]byte, error)

MarshalJSON serialize in JSON

func (*NextHopTraversalStep) Values added in v0.21.0

func (t *NextHopTraversalStep) Values() []interface{}

Values return the nexthops

type NodesGremlinTraversalStep

type NodesGremlinTraversalStep struct {
	traversal.GremlinTraversalContext
}

NodesGremlinTraversalStep nodes step

func (*NodesGremlinTraversalStep) Context

Context Nodes step

func (*NodesGremlinTraversalStep) Exec

Exec Nodes step

func (*NodesGremlinTraversalStep) Reduce

Reduce Nodes step

type RawPacketsGremlinTraversalStep

type RawPacketsGremlinTraversalStep struct {
	traversal.GremlinTraversalContext
}

RawPacketsGremlinTraversalStep rawpackets step

func (*RawPacketsGremlinTraversalStep) Context

Context RawPackets step

func (*RawPacketsGremlinTraversalStep) Exec

Exec RawPackets step

func (*RawPacketsGremlinTraversalStep) Reduce

Reduce RawPackets step

type RawPacketsTraversalExtension added in v0.19.0

type RawPacketsTraversalExtension struct {
	RawPacketsToken traversal.Token
}

RawPacketsTraversalExtension describes a new extension to enhance the topology

func NewRawPacketsTraversalExtension added in v0.19.0

func NewRawPacketsTraversalExtension() *RawPacketsTraversalExtension

NewRawPacketsTraversalExtension returns a new graph traversal extension

func (*RawPacketsTraversalExtension) ParseStep added in v0.19.0

ParseStep parse metrics step

func (*RawPacketsTraversalExtension) ScanIdent added in v0.19.0

ScanIdent returns an associated graph token

type RawPacketsTraversalStep

type RawPacketsTraversalStep struct {
	GraphTraversal *traversal.GraphTraversal
	// contains filtered or unexported fields
}

RawPacketsTraversalStep rawpackets step

func (*RawPacketsTraversalStep) BPF

BPF returns only the raw packets that matches the specified BPF filter

func (*RawPacketsTraversalStep) Error

func (r *RawPacketsTraversalStep) Error() error

Error returns traversal error

func (*RawPacketsTraversalStep) MarshalJSON

func (r *RawPacketsTraversalStep) MarshalJSON() ([]byte, error)

MarshalJSON serialize in JSON

func (*RawPacketsTraversalStep) Values

func (r *RawPacketsTraversalStep) Values() []interface{}

Values returns list of raw packets

type SocketsGremlinTraversalStep added in v0.17.0

type SocketsGremlinTraversalStep struct {
	traversal.GremlinTraversalContext
}

SocketsGremlinTraversalStep describes the Sockets gremlin traversal step

func (*SocketsGremlinTraversalStep) Context added in v0.17.0

Context sockets step

func (*SocketsGremlinTraversalStep) Exec added in v0.17.0

Exec executes the metrics step

func (*SocketsGremlinTraversalStep) Reduce added in v0.17.0

Reduce flow step

type SocketsTraversalExtension added in v0.17.0

type SocketsTraversalExtension struct {
	SocketsToken traversal.Token
}

SocketsTraversalExtension describes a new extension to enhance the topology

func NewSocketsTraversalExtension added in v0.17.0

func NewSocketsTraversalExtension() *SocketsTraversalExtension

NewSocketsTraversalExtension returns a new graph traversal extension

func (*SocketsTraversalExtension) ParseStep added in v0.17.0

ParseStep parse connections step

func (*SocketsTraversalExtension) ScanIdent added in v0.17.0

ScanIdent returns an associated graph token

type SocketsTraversalStep added in v0.17.0

type SocketsTraversalStep struct {
	GraphTraversal *traversal.GraphTraversal
	// contains filtered or unexported fields
}

SocketsTraversalStep connections step

func Sockets added in v0.17.0

Sockets returns a sockets step from host/namespace sockets

func (*SocketsTraversalStep) Error added in v0.17.0

func (s *SocketsTraversalStep) Error() error

Error returns traversal error

func (*SocketsTraversalStep) Has added in v0.17.0

func (s *SocketsTraversalStep) Has(ctx traversal.StepContext, params ...interface{}) *SocketsTraversalStep

Has step

func (*SocketsTraversalStep) HasEither added in v0.21.0

func (s *SocketsTraversalStep) HasEither(ctx traversal.StepContext, params ...interface{}) *SocketsTraversalStep

HasEither step

func (*SocketsTraversalStep) MarshalJSON added in v0.17.0

func (s *SocketsTraversalStep) MarshalJSON() ([]byte, error)

MarshalJSON serialize in JSON

func (*SocketsTraversalStep) PropertyValues added in v0.17.0

func (s *SocketsTraversalStep) PropertyValues(ctx traversal.StepContext, keys ...interface{}) *traversal.GraphTraversalValue

PropertyValues returns a flow field value

func (*SocketsTraversalStep) Values added in v0.17.0

func (s *SocketsTraversalStep) Values() []interface{}

Values returns list of socket informations

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL