flow

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: BSD-3-Clause-Clear Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const AS string = "as"
View Source
const ASEgress string = "as-egress"
View Source
const ASIngress string = "as-ingress"
View Source
const Addr string = "addr"
View Source
const ApplicationName string = "application-name"
View Source
const Ascending string = "ascending"
View Source
const Avg string = "avg"
View Source
const BGPLocalPref string = "bgp-localpref"
View Source
const BGPMed string = "bgp-med"
View Source
const BidirectionalLeft string = "bidirectional-left"
View Source
const BidirectionalRight string = "bidirectional-right"
View Source
const City string = "city"
View Source
const Community string = "community"
View Source
const Count string = "count"
View Source
const Country string = "country"
View Source
const Descending string = "descending"
View Source
const Device string = "device"
View Source
const DstAS string = "dst-as"
View Source
const DstASPath string = "dst-as-path"
View Source
const DstAddr string = "dst-addr"
View Source
const DstCity string = "dst-city"
View Source
const DstCountry string = "dst-country"
View Source
const DstMask string = "dst-mask"
View Source
const DstPort string = "dst-port"
View Source
const ExporterAS string = "exporter-as"
View Source
const ExporterID string = "exporter-id"
View Source
const ExporterIP string = "exporter-ip"
View Source
const FlowRole string = "flow-role"
View Source
const Flows string = "flows"
View Source
const IPVersion string = "ip-version"
View Source
const InputInterface string = "input-interface"
View Source
const Interface string = "interface"
View Source
const L2EthernetType string = "l2-ethernet-type"
View Source
const L2MACAddr string = "l2-mac-addr"
View Source
const L2MACDstAddr string = "l2-mac-dst-addr"
View Source
const L2MACSrcAddr string = "l2-mac-src-addr"
View Source
const L3IPMaxTTL string = "l3-ip-max-ttl"
View Source
const L3IPMaxTotalLength string = "l3-ip-max-total-length"
View Source
const L3IPMinTTL string = "l3-ip-min-ttl"
View Source
const L3IPMinTotalLength string = "l3-ip-min-total-length"
View Source
const L3IPTTL string = "l3-ip-ttl"
View Source
const L3IPTotalLength string = "l3-ip-total-length"
View Source
const L4TCPFlag string = "l4-tcp-flag"
View Source
const L4TCPFlagCount string = "l4-tcp-flag-count"
View Source
const Location string = "location"
View Source
const MPLSLabelStackDepth string = "mpls-label-stack-depth"
View Source
const MPLSLabelStackLength string = "mpls-label-stack-length"
View Source
const MPLSPostTopLabelExp string = "mpls-post-top-label-exp"
View Source
const MPLSTopLabelExp string = "mpls-top-label-exp"
View Source
const MPLSTopLabelIPv4 string = "mpls-top-label-ipv4"
View Source
const MPLSTopLabelIPv6 string = "mpls-top-label-ipv6"
View Source
const MPLSTopLabelPrefixLength string = "mpls-top-label-prefix-length"
View Source
const MPLSTopLabelStackSection string = "mpls-top-label-stack-section"
View Source
const MPLSTopLabelStackSection1 string = "mpls-top-label-stack-section1"
View Source
const MPLSTopLabelStackSection2 string = "mpls-top-label-stack-section2"
View Source
const MPLSTopLabelStackSection3 string = "mpls-top-label-stack-section3"
View Source
const MPLSTopLabelStackSection4 string = "mpls-top-label-stack-section4"
View Source
const MPLSTopLabelStackSection5 string = "mpls-top-label-stack-section5"
View Source
const MPLSTopLabelStackSection6 string = "mpls-top-label-stack-section6"
View Source
const MPLSTopLabelStackSection7 string = "mpls-top-label-stack-section7"
View Source
const MPLSTopLabelStackSection8 string = "mpls-top-label-stack-section8"
View Source
const MPLSTopLabelStackSection9 string = "mpls-top-label-stack-section9"
View Source
const MPLSTopLabelTTL string = "mpls-top-label-ttl"
View Source
const MPLSTopLabelType string = "mpls-top-label-type"
View Source
const MPLSVpnRouteDistinguisher string = "mpls-vpn-route-distinguisher"
View Source
const Max string = "max"
View Source
const Min string = "min"
View Source
const NextHop string = "next-hop"
View Source
const Octets string = "octets"
View Source
const OutputInterface string = "output-interface"
View Source
const Packets string = "packets"
View Source
const Port string = "port"
View Source
const Protocol string = "protocol"
View Source
const PseudoWireControlWord string = "pseudo-wire-control-word"
View Source
const PseudoWireID string = "pseudo-wire-id"
View Source
const PseudoWireType string = "pseudo-wire-type"
View Source
const Seconds string = "seconds"
View Source
const SrcAS string = "src-as"
View Source
const SrcASPath string = "src-as-path"
View Source
const SrcAddr string = "src-addr"
View Source
const SrcCity string = "src-city"
View Source
const SrcCountry string = "src-country"
View Source
const SrcMask string = "src-mask"
View Source
const SrcPort string = "src-port"
View Source
const Sum string = "sum"
View Source
const TOS string = "tos"
View Source
const TS string = "ts"
View Source
const Uniq string = "uniq"

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseFilter

type BaseFilter struct {
	Condition Condition `json:"condition"`
	Rules     []RuleP   `json:"rules"`
}

type Condition

type Condition string
const AND Condition = "and"
const OR Condition = "or"

func (Condition) String

func (con Condition) String() string

type CountryR

type CountryR struct {
	Code string `json:"code"`
	Name string `json:"name"`
}

type Filter

type Filter struct {
	Condition Condition        `json:"condition"`
	Rules     []map[string]any `json:"rules"`
}

func AddRule

func AddRule[T RuleVal](f *Filter, key string, op Operator, value T) *Filter

func AddSubFilterRule

func AddSubFilterRule(f *Filter, value *SubFilter) *Filter

func NewFilter

func NewFilter(c Condition) *Filter

type Operator

type Operator string
const EQ Operator = "eq"
const GE Operator = "ge"
const GT Operator = "gt"
const LE Operator = "le"
const LT Operator = "lt"
const NEQ Operator = "noteq"

func (Operator) String

func (op Operator) String() string

type PercentileData

type PercentileData struct {
	Timestamp time.Time
	Data      float64
}

func (*PercentileData) UnmarshalJSON

func (p *PercentileData) UnmarshalJSON(b []byte) error

type QueryParameters

type QueryParameters struct {
	// required
	StartTime time.Time `json:"start-time"`

	// required
	EndTime time.Time `json:"end-time"`

	Filters *Filter `json:"filters"`

	// ts, ip-version, src-addr, dst-addr, tos, protocol, src-port, dst-port, input-interface,
	// output-interface, src-mask, dst-mask, src-as, dst-as, next-hop, src-as-path, dst-as-path,
	// src-country, dst-country, src-city, dst-city, exporter-ip, exporter-id, exporter-as,
	// bgp-localpref, bgp-med, l2-mac-src-addr, l2-mac-dst-addr, l2-ethernet-type,
	// mpls-top-label-stack-section, mpls-top-label-stack-section1, mpls-top-label-stack-section2,
	// mpls-top-label-stack-section3, mpls-top-label-stack-section4, mpls-top-label-stack-section5,
	// mpls-top-label-stack-section6, mpls-top-label-stack-section7, mpls-top-label-stack-section8,
	// mpls-top-label-stack-section9, mpls-top-label-type, mpls-top-label-ipv4,
	// mpls-vpn-route-distinguisher, mpls-top-label-prefix-length, mpls-top-label-ipv6,
	// mpls-top-label-ttl, mpls-label-stack-length, mpls-label-stack-depth, mpls-top-label-exp,
	// mpls-post-top-label-exp, pseudo-wire-id, pseudo-wire-type, pseudo-wire-control-word,
	// community, l3-ip-min-total-length, l3-ip-max-total-length, l3-ip-total-length,
	// l3-ip-min-ttl, l3-ip-max-ttl, l3-ip-ttl, l4-tcp-flag, flow-role, application-name
	GroupBy string `json:"groupby,omitempty"`

	// ts, ip-version, src-addr, dst-addr, tos, protocol, src-port, dst-port,
	// input-interface, output-interface, src-mask, dst-mask, src-as, dst-as,
	// next-hop, octets, packets, flows, src-vlan, dst-vlan, dst-as-path, src-as-path,
	// src-country, dst-country, src-city, dst-city, bgp-localpref, bgp-med, exporter-ip,
	// exporter-id, exporter-as, l2-mac-src-addr, l2-mac-dst-addr, l2-ethernet-type,
	// mpls-top-label-stack-section, mpls-top-label-stack-section1, mpls-top-label-stack-section2,
	// mpls-top-label-stack-section3, mpls-top-label-stack-section4, mpls-top-label-stack-section5,
	// mpls-top-label-stack-section6, mpls-top-label-stack-section7, mpls-top-label-stack-section8,
	// mpls-top-label-stack-section9, mpls-top-label-type, mpls-top-label-ipv4,
	// mpls-vpn-route-distinguisher, mpls-top-label-prefix-length, mpls-top-label-ipv6,
	// mpls-top-label-ttl, mpls-label-stack-length, mpls-label-stack-depth, mpls-top-label-exp,
	// mpls-post-top-label-exp, pseudo-wire-id, pseudo-wire-type, pseudo-wire-control-word,
	// community, l3-ip-min-total-length, l3-ip-max-total-length, l3-ip-total-length, l3-ip-min-ttl,
	// l3-ip-max-ttl, l3-ip-ttl, l4-tcp-syn-count, l4-tcp-fin-count, l4-tcp-rst-count,
	// l4-tcp-psh-count, l4-tcp-ack-count, l4-tcp-urg-count, flow-role, application-name
	TableColumns []string `json:"table-columns,omitempty"`

	// octets, packets, flows, l4-tcp-flag-count
	AggregateBy string `json:"aggregate-by,omitempty"`

	// count, min, max, avg, uniq, sum
	AggregateFunction string `json:"aggregate-function,omitempty"`

	// ts, ip-version, src-addr, dst-addr, tos, protocol, src-port, dst-port, input-interface,
	// output-interface, src-mask, dst-mask, src-as, dst-as, next-hop, src-as-path, dst-as-path,
	// octets, packets, exporter-ip, exporter-id, exporter-as, flows, bgp-localpref, bgp-med,
	// l2-mac-src-addr, l2-mac-dst-addr, l2-ethernet-type, mpls-top-label-stack-section,
	// mpls-top-label-stack-section1, mpls-top-label-stack-section2, mpls-top-label-stack-section3,
	// mpls-top-label-stack-section4, mpls-top-label-stack-section5, mpls-top-label-stack-section6,
	// mpls-top-label-stack-section7, mpls-top-label-stack-section8, mpls-top-label-stack-section9,
	// mpls-top-label-type, mpls-top-label-ipv4, mpls-vpn-route-distinguisher,
	// mpls-top-label-prefix-length, mpls-top-label-ipv6, mpls-top-label-ttl,
	// mpls-label-stack-length, mpls-label-stack-depth, mpls-top-label-exp,
	// mpls-post-top-label-exp, pseudo-wire-id, pseudo-wire-type, pseudo-wire-control-word,
	// community, l3-ip-min-total-length, l3-ip-max-total-length, l3-ip-total-length,
	// l3-ip-min-ttl, l3-ip-max-ttl, l3-ip-ttl, l4-tcp-flag-count, flow-role, application-name
	OrderBy string `json:"orderby,omitempty"`

	// descending, ascending
	Order string `json:"order,omitempty"`

	Top      uint32 `json:"top,omitempty"`
	Page     uint32 `json:"page,omitempty"`
	PageSize uint16 `json:"page-size,omitempty"`

	// location, device, interface
	FiltersNarrowBy []string `json:"filters-narrow-by,omitempty"`

	// seconds
	RateUnit string `json:"rate-unit,omitempty"`

	IsolateEmptySpaces  bool  `json:"isolate-empty-spaces,omitempty"`
	GroupBySrcPrefix    bool  `json:"group-by-src-prefix,omitempty"`
	GroupBySrcPrefixLen bool  `json:"group-by-src-prefix-length,omitempty"`
	GroupByDstPrefix    bool  `json:"group-by-dst-prefix,omitempty"`
	GroupByDstPrefixLen bool  `json:"group-by-dst-prefix-length,omitempty"`
	ASPathPrependRemove bool  `json:"as-path-prepend-remove,omitempty"`
	Percentile          uint8 `json:"percentile,omitempty"`
	Dictionary          bool  `json:"dictionary,omitempty"`
	TableMinMax         bool  `json:"table-min-max,omitempty"`

	// addr, port, as, country, city, l2-mac-addr
	GroupByBidirectional string `json:"groupby-bidirectional,omitempty"`

	GroupByTSBidirectional bool `json:"groupby-ts-bidirectional,omitempty"`

	// ts, octets, flows, packets, l4-tcp-flag-count, bidirectional-left, bidirectional-right
	OrderByBidirectional string `json:"orderby-bidirectional,omitempty"`

	// as-ingress, as-egress
	TrafficDirection string `json:"traffic-direction,omitempty"`

	// minimum 60
	Step uint32 `json:"step,omitempty"`
}

func (*QueryParameters) MarshalQuery

func (q *QueryParameters) MarshalQuery() (map[string]string, error)

type QueryResults

type QueryResults struct {
	Code string `json:"code"`
}

type ResPercentileQuery

type ResPercentileQuery struct {
	Results         []QueryResults   `json:"results"`
	PercentileValue float64          `json:"percentileValue"`
	QueryParams     map[string]any   `json:"queryParams"`
	Title           string           `json:"title"`
	Header          []string         `json:"header"`
	Step            int              `json:"step"`
	Data            []PercentileData `json:"data"`
}

type RuleInterface

type RuleInterface interface {
	Key() string
	Value() any
	Operator() Operator
}

type RuleP

type RuleP struct {
	Key      string   `json:"key"`
	Operator Operator `json:"comparisonOperator"`
	Value    any      `json:"value"`
}

type RuleVal

type RuleVal interface {
	string | int | uint8 | uint16 | uint32 | uint64 | []string | []uint32 | CountryR
}

type SubFilter

type SubFilter struct {
	Condition Condition        `json:"condition"`
	Rules     []map[string]any `json:"rules"`
}

func AddSubRule

func AddSubRule[T RuleVal](sf *SubFilter, key string, op Operator, value T) *SubFilter

func NewSubFilter

func NewSubFilter(c Condition) *SubFilter

Jump to

Keyboard shortcuts

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