types

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2018 License: Apache-2.0 Imports: 6 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	BasicResource
	Name        string `json:",omitempty"`
	Description string `json:",omitempty"`
	Expression  string `json:",omitempty" valid:"nonzero"`
	Action      string `json:",omitempty" valid:"regexp=^(|http://|https://|file://).*$"`
	Trigger     string `json:",omitempty" valid:"regexp=^(graph|duration:.+|)$"`
	CreateTime  time.Time
}

Alert is a set of parameters, the Alert Action will Trigger according to its Expression.

func NewAlert

func NewAlert() *Alert

NewAlert creates a New empty Alert, only UUID and CreateTime are set.

type BasicResource added in v0.19.0

type BasicResource struct {
	UUID string `yaml:"UUID"`
}

BasicResource is a resource with a unique identifier

func (*BasicResource) ID added in v0.19.0

func (b *BasicResource) ID() string

ID returns the alert ID

func (*BasicResource) SetID added in v0.19.0

func (b *BasicResource) SetID(i string)

SetID set ID

type Capture

type Capture struct {
	BasicResource
	GremlinQuery   string           `json:"GremlinQuery,omitempty" valid:"isGremlinExpr"`
	BPFFilter      string           `json:"BPFFilter,omitempty" valid:"isBPFFilter"`
	Name           string           `json:"Name,omitempty"`
	Description    string           `json:"Description,omitempty"`
	Type           string           `json:"Type,omitempty"`
	Count          int              `json:"Count"`
	PCAPSocket     string           `json:"PCAPSocket,omitempty"`
	Port           int              `json:"Port,omitempty"`
	RawPacketLimit int              `json:"RawPacketLimit,omitempty" valid:"isValidRawPacketLimit"`
	HeaderSize     int              `json:"HeaderSize,omitempty" valid:"isValidCaptureHeaderSize"`
	ExtraTCPMetric bool             `json:"ExtraTCPMetric"`
	IPDefrag       bool             `json:"IPDefrag"`
	ReassembleTCP  bool             `json:"ReassembleTCP"`
	LayerKeyMode   string           `json:"LayerKeyMode,omitempty" valid:"isValidLayerKeyMode"`
	ExtraLayers    flow.ExtraLayers `json:"ExtraLayers,omitempty"`
}

Capture describes a capture API

func NewCapture

func NewCapture(query string, bpfFilter string) *Capture

NewCapture creates a new capture

type EdgeRule added in v0.19.1

type EdgeRule struct {
	UUID        string
	Name        string
	Description string
	Src         string `valid:"isGremlinExpr"`
	Dst         string `valid:"isGremlinExpr"`
	Metadata    graph.Metadata
}

EdgeRule describes a edge rule

func (*EdgeRule) ID added in v0.19.1

func (e *EdgeRule) ID() string

ID returns the edge rule ID

func (*EdgeRule) SetID added in v0.19.1

func (e *EdgeRule) SetID(id string)

SetID set ID

func (*EdgeRule) Validate added in v0.20.0

func (e *EdgeRule) Validate() error

Validate verifies the nodedgee rule does not create invalid edges

type NodeRule added in v0.19.1

type NodeRule struct {
	UUID        string
	Name        string
	Description string
	Metadata    graph.Metadata
	Action      string `valid:"regexp=^(create|update)$"`
	Query       string `valid:"isGremlinOrEmpty"`
}

NodeRule describes a node rule

func (*NodeRule) ID added in v0.19.1

func (n *NodeRule) ID() string

ID returns the node rule ID

func (*NodeRule) SetID added in v0.19.1

func (n *NodeRule) SetID(id string)

SetID set ID

func (*NodeRule) Validate added in v0.20.0

func (n *NodeRule) Validate() error

Validate verifies the node rule does not create invalid node or change important attributes of an existing node

type PacketInjection added in v0.17.0

type PacketInjection struct {
	BasicResource
	Src        string
	Dst        string
	SrcIP      string
	DstIP      string
	SrcMAC     string
	DstMAC     string
	SrcPort    int64
	DstPort    int64
	Type       string
	Payload    string
	TrackingID string
	ICMPID     int64
	Count      int64
	Interval   int64
	Increment  bool
	StartTime  time.Time
	Pcap       []byte
}

PacketInjection packet injector API parameters

func (*PacketInjection) Validate added in v0.17.0

func (pi *PacketInjection) Validate() error

Validate verifies the packet injection type is supported

type Resource

type Resource interface {
	ID() string
	SetID(string)
}

Resource used as interface resources for each API

type TopologyParam

type TopologyParam struct {
	GremlinQuery string `json:"GremlinQuery,omitempty" valid:"isGremlinExpr"`
}

TopologyParam topology API parameter

type Workflow added in v0.19.0

type Workflow struct {
	BasicResource `yaml:",inline"`
	Name          string          `yaml:"name" valid:"nonzero"`
	Description   string          `yaml:"description"`
	Parameters    []WorkflowParam `yaml:"parameters"`
	Source        string          `valid:"isValidWorkflow" yaml:"source"`
}

Workflow describes a workflow

type WorkflowChoice added in v0.19.0

type WorkflowChoice struct {
	Value       string `yaml:"value"`
	Description string `yaml:"description"`
}

WorkflowChoice describes one value within a choice

type WorkflowParam added in v0.19.0

type WorkflowParam struct {
	Name        string
	Description string
	Type        string
	Default     interface{}
	Values      []WorkflowChoice
}

WorkflowParam describes a workflow parameter

Jump to

Keyboard shortcuts

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