types

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	Resource
	UUID        string
	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.

func (*Alert) ID

func (a *Alert) ID() string

ID returns the alert ID

func (*Alert) SetID

func (a *Alert) SetID(i string)

SetID set ID

type AnalyzerStatus

type AnalyzerStatus struct {
	Agents      map[string]shttp.WSConnStatus
	Peers       PeersStatus
	Publishers  map[string]shttp.WSConnStatus
	Subscribers map[string]shttp.WSConnStatus
	Alerts      ElectionStatus
	Captures    ElectionStatus
	Probes      []string
}

AnalyzerStatus describes the status of an analyzer

type Capture

type Capture struct {
	UUID           string
	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"`
}

Capture describes a capture API

func NewCapture

func NewCapture(query string, bpfFilter string) *Capture

NewCapture creates a new capture

func (*Capture) ID

func (c *Capture) ID() string

ID returns the capture Identifier

func (*Capture) SetID

func (c *Capture) SetID(i string)

SetID set a new identifier for this capture

type ElectionStatus

type ElectionStatus struct {
	IsMaster bool
}

ElectionStatus describes the status of an election

type PacketInjection added in v0.18.0

type PacketInjection struct {
	UUID       string
	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
}

PacketInjection packet injector API parameters

func (*PacketInjection) ID added in v0.18.0

func (pi *PacketInjection) ID() string

ID returns the packet injector request identifier

func (*PacketInjection) SetID added in v0.18.0

func (pi *PacketInjection) SetID(id string)

SetID set a new identifier for this injector

func (*PacketInjection) Validate added in v0.18.0

func (pi *PacketInjection) Validate() error

Validate verifies the packet injection type is supported

type PeersStatus

type PeersStatus struct {
	Incomers map[string]shttp.WSConnStatus
	Outgoers map[string]shttp.WSConnStatus
}

PeersStatus describes the state of a peer

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 UserMetadata

type UserMetadata struct {
	UUID         string
	GremlinQuery string `valid:"isGremlinExpr"`
	Key          string `valid:"nonzero"`
	Value        string `valid:"nonzero"`
}

UserMetadata describes a user metadata

func NewUserMetadata

func NewUserMetadata(query string, key string, value string) *UserMetadata

NewUserMetadata creates a new user metadata

func (*UserMetadata) ID

func (m *UserMetadata) ID() string

ID returns the user metadata identifier

func (*UserMetadata) SetID

func (m *UserMetadata) SetID(id string)

SetID set a new identifier for this user metadata

Source Files

  • types.go

Jump to

Keyboard shortcuts

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