traversal

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 {
	// contains filtered or unexported fields
}

AggregatesGremlinTraversalStep aggregates step

func (*AggregatesGremlinTraversalStep) Context

Context Aggregates step

func (*AggregatesGremlinTraversalStep) Exec

Exec Aggregates step

func (*AggregatesGremlinTraversalStep) Reduce

Reduce Aggregates step

type BpfGremlinTraversalStep

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

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 {
	// contains filtered or unexported fields
}

CaptureNodeGremlinTraversalStep capture step

func (*CaptureNodeGremlinTraversalStep) Context

Context step

func (*CaptureNodeGremlinTraversalStep) Exec

Exec Capture step

func (*CaptureNodeGremlinTraversalStep) Reduce

Reduce Capture step

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
	RawPacketsToken  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 tranversal 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(s ...interface{}) *traversal.GraphTraversalV

Both returns A and B nodes

func (*FlowTraversalStep) CaptureNode

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

CaptureNode step

func (*FlowTraversalStep) Count

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

Count step

func (*FlowTraversalStep) Dedup

func (f *FlowTraversalStep) Dedup(keys ...interface{}) *FlowTraversalStep

Dedup deduplicate step

func (*FlowTraversalStep) Error

func (f *FlowTraversalStep) Error() error

Error returns tranversal error

func (*FlowTraversalStep) FlowMetrics

func (f *FlowTraversalStep) FlowMetrics() *MetricsTraversalStep

FlowMetrics returns flow metric counters

func (*FlowTraversalStep) Has

func (f *FlowTraversalStep) Has(s ...interface{}) *FlowTraversalStep

Has step

func (*FlowTraversalStep) Hops

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

Hops returns all the capture nodes where the flow was seen

func (*FlowTraversalStep) In

func (f *FlowTraversalStep) In(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(s ...interface{}) *traversal.GraphTraversalV

Nodes returns A, B and the capture nodes

func (*FlowTraversalStep) Out

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

Out returns the B node

func (*FlowTraversalStep) PropertyKeys

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

PropertyKeys returns a flow field

func (*FlowTraversalStep) PropertyValues

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

PropertyValues returns a flow field value

func (*FlowTraversalStep) RawPackets

func (f *FlowTraversalStep) RawPackets() *RawPacketsTraversalStep

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

func (*FlowTraversalStep) Sort

func (f *FlowTraversalStep) Sort(keys ...interface{}) *FlowTraversalStep

Sort step

func (*FlowTraversalStep) Sum

func (f *FlowTraversalStep) Sum(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 HopsGremlinTraversalStep

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

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 {
	// contains filtered or unexported fields
}

func (*MetricsGremlinTraversalStep) Context

func (*MetricsGremlinTraversalStep) Exec

Exec executes the metrics step

func (*MetricsGremlinTraversalStep) Reduce

Reduce flow 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

func InterfaceMetrics(tv *traversal.GraphTraversalV) *MetricsTraversalStep

InterfaceMetrics returns a Metrics step from interface metric metadata

func NewMetricsTraversalStep

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

NewMetricsTraversalStep creates a new tranversal metric step

func (*MetricsTraversalStep) Aggregates

func (m *MetricsTraversalStep) Aggregates() *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(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) Sum

func (m *MetricsTraversalStep) Sum(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 NodesGremlinTraversalStep

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

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 {
	// contains filtered or unexported fields
}

RawPacketsGremlinTraversalStep rawpackets step

func (*RawPacketsGremlinTraversalStep) Context

Context RawPackets step

func (*RawPacketsGremlinTraversalStep) Exec

Exec RawPackets step

func (*RawPacketsGremlinTraversalStep) Reduce

Reduce RawPackets step

type RawPacketsTraversalStep

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

RawPacketsTraversalStep rawpackets step

func (*RawPacketsTraversalStep) BPF

func (r *RawPacketsTraversalStep) BPF(s ...interface{}) *RawPacketsTraversalStep

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

func (*RawPacketsTraversalStep) Error

func (r *RawPacketsTraversalStep) Error() error

Error returns tranversal 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

Source Files

  • flows.go
  • metrics.go
  • token.go
  • topology.go

Jump to

Keyboard shortcuts

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