types

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2019 License: Apache-2.0 Imports: 5 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 `yaml:",inline"`
	Name          string `json:",omitempty" yaml:"Name"`
	Description   string `json:",omitempty" yaml:"Description"`
	Expression    string `json:",omitempty" valid:"nonzero" yaml:"Expression"`
	Action        string `json:",omitempty" valid:"regexp=^(|http://|https://|file://).*$" yaml:"Action"`
	Trigger       string `json:",omitempty" valid:"regexp=^(graph|duration:.+|)$" yaml:"Trigger"`
	CreateTime    time.Time
}

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

func NewAlert

func NewAlert() *Alert

NewAlert creates a New empty Alert, only CreateTime is set.

func (*Alert) GetName added in v0.24.0

func (a *Alert) GetName() string

GetName returns the resource name

type BasicResource added in v0.19.0

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

BasicResource is a resource with a unique identifier easyjson:json

func (*BasicResource) GetName added in v0.24.0

func (b *BasicResource) GetName() string

GetName returns the resource name

func (*BasicResource) ID added in v0.19.0

func (b *BasicResource) ID() string

ID returns the resource ID

func (*BasicResource) SetID added in v0.19.0

func (b *BasicResource) SetID(i string)

SetID sets the resource ID

type Capture

type Capture struct {
	BasicResource   `yaml:",inline"`
	GremlinQuery    string           `json:"GremlinQuery,omitempty" valid:"isGremlinExpr" yaml:"GremlinQuery"`
	BPFFilter       string           `json:"BPFFilter,omitempty" valid:"isBPFFilter" yaml:"BPFFilter"`
	Name            string           `json:"Name,omitempty" yaml:"Name"`
	Description     string           `json:"Description,omitempty" yaml:"Description"`
	Type            string           `json:"Type,omitempty" valid:"isValidCaptureType" yaml:"Type"`
	Count           int              `json:"Count" yaml:"Count"`
	Port            int              `json:"Port,omitempty" yaml:"Port"`
	SamplingRate    uint32           `json:"SamplingRate" yaml:"SamplingRate"`
	PollingInterval uint32           `json:"PollingInterval" yaml:"PollingInterval"`
	RawPacketLimit  int              `json:"RawPacketLimit,omitempty" valid:"isValidRawPacketLimit" yaml:"RawPacketLimit"`
	HeaderSize      int              `json:"HeaderSize,omitempty" valid:"isValidCaptureHeaderSize" yaml:"HeaderSize"`
	ExtraTCPMetric  bool             `json:"ExtraTCPMetric" yaml:"ExtraTCPMetric"`
	IPDefrag        bool             `json:"IPDefrag" yaml:"IPDefrag"`
	ReassembleTCP   bool             `json:"ReassembleTCP" yaml:"ReassembleTCP"`
	LayerKeyMode    string           `json:"LayerKeyMode,omitempty" valid:"isValidLayerKeyMode" yaml:"LayerKeyMode"`
	ExtraLayers     flow.ExtraLayers `json:"ExtraLayers,omitempty" yaml:"ExtraLayers"`
	Target          string           `json:"Target,omitempty" valid:"isValidAddress" yaml:"Target"`
	TargetType      string           `json:"TargetType,omitempty" yaml:"TargetType"`
}

Capture describes a capture API easyjson:json

func NewCapture

func NewCapture(query string, bpfFilter string) *Capture

NewCapture creates a new capture

func (*Capture) GetName added in v0.24.0

func (c *Capture) GetName() string

GetName returns the resource name

type EdgeRule added in v0.19.1

type EdgeRule struct {
	BasicResource `yaml:",inline"`
	Name          string         `yaml:"Name"`
	Description   string         `yaml:"Description"`
	Src           string         `valid:"isGremlinExpr" yaml:"Src"`
	Dst           string         `valid:"isGremlinExpr" yaml:"Dst"`
	Metadata      graph.Metadata `yaml:"Metadata"`
}

EdgeRule describes a edge rule easyjson:json

func (*EdgeRule) GetName added in v0.24.0

func (e *EdgeRule) GetName() string

GetName returns the resource name

func (*EdgeRule) Validate added in v0.20.0

func (e *EdgeRule) Validate() error

Validate verifies the edge rule does not create invalid edges

type NodeRule added in v0.19.1

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

NodeRule describes a node rule easyjson:json

func (*NodeRule) GetName added in v0.24.0

func (n *NodeRule) GetName() string

GetName returns the resource name

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    `yaml:",inline"`
	Src              string `yaml:"Src"`
	Dst              string `yaml:"Dst"`
	SrcIP            string `valid:"isIPOrCIDR" yaml:"SrcIP"`
	DstIP            string `valid:"isIPOrCIDR" yaml:"DstIP"`
	SrcMAC           string `valid:"isMAC" yaml:"SrcMAC"`
	DstMAC           string `valid:"isMAC" yaml:"DstMAC"`
	SrcPort          uint16 `yaml:"SrcPort"`
	DstPort          uint16 `yaml:"DstPort"`
	Type             string `yaml:"Type"`
	Payload          string `yaml:"Payload"`
	ICMPID           uint16 `yaml:"ICMPID"`
	Count            uint64 `yaml:"Count"`
	Interval         uint64 `yaml:"Interval"`
	Increment        bool   `yaml:"Increment"`
	IncrementPayload int64  `yaml:"IncrementPayload"`
	StartTime        time.Time
	Pcap             []byte `yaml:"Pcap"`
	TTL              uint8  `yaml:"TTL"`
}

PacketInjection packet injector API parameters easyjson:json

func (*PacketInjection) GetName added in v0.24.0

func (pi *PacketInjection) GetName() string

GetName returns the resource name

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)
	GetName() string
}

Resource used as interface resources for each API

type TopologyParam

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

TopologyParam topology API parameter easyjson:json

type Workflow added in v0.19.0

type Workflow struct {
	BasicResource `yaml:",inline"`
	Name          string          `yaml:"Name" valid:"nonzero"`
	Title         string          `yaml:"Title"`
	Abstract      string          `yaml:"Abstract"`
	Description   string          `yaml:"Description"`
	Parameters    []WorkflowParam `yaml:"Parameters"`
	Source        string          `valid:"isValidWorkflow" yaml:"Source"`
}

Workflow describes a workflow easyjson:json

type WorkflowCall added in v0.23.0

type WorkflowCall struct {
	Params []interface{}
}

WorkflowCall describes workflow call

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 easyjson:json

type WorkflowParam added in v0.19.0

type WorkflowParam struct {
	Name        string           `yaml:"Name"`
	Description string           `yaml:"Description"`
	Type        string           `yaml:"Type"`
	Default     interface{}      `yaml:"Default"`
	Values      []WorkflowChoice `yaml:"Values"`
}

WorkflowParam describes a workflow parameter easyjson:json

Jump to

Keyboard shortcuts

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