vanflow

package module
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

vanflow Godoc

vanflow is a Go library implementing the skupper.io Vanflow protocol.

What's included

  • The vanflow root package defines the messages and record types defined in the vanflow specification (unpublished version 0.1.)
  • The encoding package provides utilities for converting between amqp value maps and the record types.
  • The eventsource package is used to discover, interact with, and to implement vanflow event sources.
  • The session package is used internally by eventsource to simplify connection and session management.
  • The still very experimental store package provides a way to store and access vanflow record information.
Executables

The vanflow-tool command is a rough utility for logging vanflow messages, for capturing and replaying VAN state.

Documentation

Overview

Package vanflow defines types for the message and record types specified in the VanFlow specification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(msg *amqp.Message) (interface{}, error)

Decode a raw amqp message into one of BeaconMessage, FlushMessage, HeartbeatMessage or RecordMessage.

Types

type BaseRecord

type BaseRecord struct {
	ID        string `vflow:"1,required"`
	StartTime *Time  `vflow:"3"`
	EndTime   *Time  `vflow:"4"`
}

func NewBase

func NewBase(id string, times ...time.Time) BaseRecord

func (BaseRecord) Identity

func (b BaseRecord) Identity() string

type BeaconMessage

type BeaconMessage struct {
	MessageProps
	Version    uint32
	SourceType string
	Address    string
	Direct     string
	Identity   string
}

func DecodeBeacon

func DecodeBeacon(msg *amqp.Message) BeaconMessage

func (BeaconMessage) Encode

func (m BeaconMessage) Encode() *amqp.Message

type CollectorRecord

type CollectorRecord struct {
	BaseRecord
}

type ConnectorRecord

type ConnectorRecord struct {
	BaseRecord
	Parent      *string `vflow:"2"`
	DestHost    *string `vflow:"15"`
	Protocol    *string `vflow:"16"`
	DestPort    *string `vflow:"18"`
	Address     *string `vflow:"19"`
	FlowCountL4 *uint64 `vflow:"40"`
	FlowCountL7 *uint64 `vflow:"41"`
	FlowRateL4  *uint64 `vflow:"42"`
	FlowRateL7  *uint64 `vflow:"43"`
}

func (ConnectorRecord) GetTypeMeta

func (r ConnectorRecord) GetTypeMeta() TypeMeta

type ControllerRecord

type ControllerRecord struct {
	BaseRecord
	Parent       *string `vflow:"2"`
	ImageName    *string `vflow:"20"`
	ImageVersion *string `vflow:"21"`
	Hostname     *string `vflow:"22"`
	Name         *string `vflow:"30"`
	BuildVersion *string `vflow:"32"`
}

func (ControllerRecord) GetTypeMeta

func (r ControllerRecord) GetTypeMeta() TypeMeta

type EgressRecord

type EgressRecord struct {
	BaseRecord
}

type FlowRecord

type FlowRecord struct {
	BaseRecord
	Parent         *string `vflow:"2"`
	Counterflow    *string `vflow:"5"`
	SourceHost     *string `vflow:"14"`
	SourcePort     *string `vflow:"17"`
	Octets         *uint64 `vflow:"23"`
	Latency        *uint64 `vflow:"24"`
	Reason         *string `vflow:"29"`
	Trace          *string `vflow:"31"`
	OctetRate      *uint64 `vflow:"35"`
	OctetsOut      *uint64 `vflow:"36"`
	OctetsUnacked  *uint64 `vflow:"37"`
	WindowClosures *uint64 `vflow:"38"`
	WindowSize     *uint64 `vflow:"39"`
	Method         *string `vflow:"27"`
	Result         *string `vflow:"28"`
}

func (FlowRecord) GetTypeMeta

func (r FlowRecord) GetTypeMeta() TypeMeta

type FlushMessage

type FlushMessage struct {
	MessageProps
}

func DecodeFlush

func DecodeFlush(msg *amqp.Message) FlushMessage

func (FlushMessage) Encode

func (m FlushMessage) Encode() *amqp.Message

type HeartbeatMessage

type HeartbeatMessage struct {
	MessageProps
	Identity string
	Version  uint32
	Now      uint64
}

func DecodeHeartbeat

func DecodeHeartbeat(msg *amqp.Message) HeartbeatMessage

func (HeartbeatMessage) Encode

func (m HeartbeatMessage) Encode() *amqp.Message

type HostRecord

type HostRecord struct {
	BaseRecord
	Provider *string `vflow:"10"`
	Name     *string `vflow:"30"`
}

func (HostRecord) GetTypeMeta

func (r HostRecord) GetTypeMeta() TypeMeta

type ImageRecord

type ImageRecord struct {
	BaseRecord
}

type IngressRecord

type IngressRecord struct {
	BaseRecord
}

type LinkRecord

type LinkRecord struct {
	BaseRecord
	Parent    *string `vflow:"2"`
	Mode      *string `vflow:"13"`
	Name      *string `vflow:"30"`
	LinkCost  *uint64 `vflow:"33"`
	Direction *string `vflow:"34"`
}

func (LinkRecord) GetTypeMeta

func (r LinkRecord) GetTypeMeta() TypeMeta

type ListenerRecord

type ListenerRecord struct {
	BaseRecord
	Parent      *string `vflow:"2"`
	DestHost    *string `vflow:"15"`
	Protocol    *string `vflow:"16"`
	DestPort    *string `vflow:"18"`
	Address     *string `vflow:"19"`
	FlowCountL4 *uint64 `vflow:"40"`
	FlowCountL7 *uint64 `vflow:"41"`
	FlowRateL4  *uint64 `vflow:"42"`
	FlowRateL7  *uint64 `vflow:"43"`
}

func (ListenerRecord) GetTypeMeta

func (r ListenerRecord) GetTypeMeta() TypeMeta

type LogRecord

type LogRecord struct {
	BaseRecord
	LogSeverity *uint64 `vflow:"48"`
	LogText     *string `vflow:"49"`
	SourceFile  *string `vflow:"50"`
	SourceLine  *uint64 `vflow:"51"`
}

func (LogRecord) GetTypeMeta

func (r LogRecord) GetTypeMeta() TypeMeta

type MessageProps

type MessageProps struct {
	To      string
	Subject string
	ReplyTo string
}

type ProcessGroupRecord

type ProcessGroupRecord struct {
	BaseRecord
}

type ProcessRecord

type ProcessRecord struct {
	BaseRecord
	Parent       *string `vflow:"2"` //unspeced
	Mode         *string `vflow:"13"`
	SourceHost   *string `vflow:"14"`
	ImageName    *string `vflow:"20"`
	ImageVersion *string `vflow:"21"`
	Hostname     *string `vflow:"22"`
	Name         *string `vflow:"30"`
	Group        *string `vflow:"46"`
}

func (ProcessRecord) GetTypeMeta

func (r ProcessRecord) GetTypeMeta() TypeMeta

type Record

type Record interface {
	Identity() string
	GetTypeMeta() TypeMeta
}

type RecordMessage

type RecordMessage struct {
	MessageProps
	Records []Record
}

func DecodeRecord

func DecodeRecord(msg *amqp.Message) (record RecordMessage, err error)

func (RecordMessage) Encode

func (m RecordMessage) Encode() (*amqp.Message, error)

type RouterRecord

type RouterRecord struct {
	BaseRecord
	Parent       *string `vflow:"2"`
	Namespace    *string `vflow:"12"`
	Mode         *string `vflow:"13"`
	ImageName    *string `vflow:"20"`
	ImageVersion *string `vflow:"21"`
	Hostname     *string `vflow:"22"`
	Name         *string `vflow:"30"`
	BuildVersion *string `vflow:"32"`
}

func (RouterRecord) GetTypeMeta

func (r RouterRecord) GetTypeMeta() TypeMeta

type SiteRecord

type SiteRecord struct {
	BaseRecord
	Location  *string `vflow:"9"`
	Provider  *string `vflow:"10"`
	Platform  *string `vflow:"11"`
	Namespace *string `vflow:"12"`
	Name      *string `vflow:"30"` //unspeced
	Version   *string `vflow:"52"`
	Policy    *string `vflow:"53"`
}

func (SiteRecord) GetTypeMeta

func (r SiteRecord) GetTypeMeta() TypeMeta

type Time

type Time struct {
	time.Time
}

func (*Time) DecodeRecordAttribute

func (t *Time) DecodeRecordAttribute(attr any) error

func (Time) EncodeRecordAttribute

func (t Time) EncodeRecordAttribute() (any, error)

type TypeMeta

type TypeMeta struct {
	APIVersion string
	Type       string
}

func (TypeMeta) String

func (m TypeMeta) String() string

Directories

Path Synopsis
cmd
vanflow-tool command
encoding exposes functionality to convert between an arbitray maps and native Go structs in service of the Vanflow protocol.
encoding exposes functionality to convert between an arbitray maps and native Go structs in service of the Vanflow protocol.
The eventsource package contains mechanisims for discovering and interracting with vanflow event sources.
The eventsource package contains mechanisims for discovering and interracting with vanflow event sources.
session implements amqp connection and session management though the concept of a Container, inspired by the Conatiner interface exposed by the qpid proton amqp libraries.
session implements amqp connection and session management though the concept of a Container, inspired by the Conatiner interface exposed by the qpid proton amqp libraries.
store contains an interface for accumulating and accessing vanflow record state, as well as an in memory cache implementation that stores records in a synchronized map.
store contains an interface for accumulating and accessing vanflow record state, as well as an in memory cache implementation that stores records in a synchronized map.
vancap module

Jump to

Keyboard shortcuts

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