tag

package
v0.0.0-...-46547a1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: ISC Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const PollInterval = 500 * time.Millisecond
View Source
const TagRingNoOp = -1

Variables

View Source
var BufConfig = []int{255, 255, 255, 255, 255, 255, 255, 255}

todo: define how this maps to multi-tags (?)

View Source
var ErrOverCapacity = errors.New("Buffy: over capacity")
View Source
var FullBuffers = errors.New("TagRing: Full Buffers")

Functions

func New

func New(opts *Options) tcpip.LinkEndpointID

New creates a new endpoint for transmitting data using AWS Lambda tags.

Types

type AwsStats

type AwsStats struct {
	RxPackets uint32
	TxPackets uint32
	TxErrors  uint32
	RxErrors  uint32
}

AwsStats collects link-specific stats.

type Buffy

type Buffy struct {
	// contains filtered or unexported fields
}

func NewBuffy

func NewBuffy(cap int) *Buffy

func (*Buffy) DecodedBytes

func (b *Buffy) DecodedBytes() ([]byte, error)

func (*Buffy) EncodedBytes

func (b *Buffy) EncodedBytes() []byte

func (*Buffy) EncodedBytesString

func (b *Buffy) EncodedBytesString() string

func (*Buffy) Len

func (b *Buffy) Len() int

func (*Buffy) Offset

func (b *Buffy) Offset() int

func (*Buffy) Read

func (b *Buffy) Read(p []byte) (n int, err error)

func (*Buffy) Replace

func (b *Buffy) Replace(p []byte) (bool, error)

func (*Buffy) Reset

func (b *Buffy) Reset()

func (*Buffy) String

func (b *Buffy) String() string

func (*Buffy) Write

func (b *Buffy) Write(p []byte) (n int, err error)

func (*Buffy) WriteUnencoded

func (b *Buffy) WriteUnencoded(p []byte) (n int, err error)

type FunctionTags

type FunctionTags map[string]string

func (FunctionTags) String

func (t FunctionTags) String() string

type Options

type Options struct {
	LocalArn      string
	RemoteArn     string
	LocalAddress  tcpip.LinkAddress
	RemoteAddress tcpip.LinkAddress
}

Options specify the details about the AWS service-based endpoint to be created.

type TagBuffer

type TagBuffer struct {
	// contains filtered or unexported fields
}

type TagConfig

type TagConfig struct {
	LambdaService *lambda.Lambda
	Endpoint      *endpoint
	RxArn         string // local (receive lambda tags)
	TxArn         string // remote (transmit lambda tags)
}

type TagHarvester

type TagHarvester struct {
	// contains filtered or unexported fields
}

func NewTagHarvester

func NewTagHarvester(d time.Duration, svc *lambda.Lambda, arn string, mux sync.Mutex, tagHandler func(map[string]*string, error)) *TagHarvester

func (*TagHarvester) Start

func (th *TagHarvester) Start()

func (*TagHarvester) Stop

func (th *TagHarvester) Stop()
type TagLink struct {
	// contains filtered or unexported fields
}

TagLink reads/writes L2 data to AWS service(s)

func NewTagLink(config *TagConfig) *TagLink

func (*TagLink) FlushReceive

func (t *TagLink) FlushReceive() (*string, error)

func (*TagLink) FlushTransmit

func (t *TagLink) FlushTransmit() (*string, error)

func (*TagLink) LinkAddressLabel

func (t *TagLink) LinkAddressLabel() string

func (*TagLink) Read

func (t *TagLink) Read(p []byte) (int, error)

Read reads one packet from the internal buffers

func (*TagLink) ReceivePacketLen

func (t *TagLink) ReceivePacketLen() int

func (*TagLink) RemoteLinkAddressLabel

func (t *TagLink) RemoteLinkAddressLabel() string

func (*TagLink) RxTagIndex

func (t *TagLink) RxTagIndex(i int) string

func (*TagLink) StartPolling

func (t *TagLink) StartPolling()

func (*TagLink) String

func (t *TagLink) String() string

func (*TagLink) TxTagIndex

func (t *TagLink) TxTagIndex(i int) string

func (*TagLink) Write

func (t *TagLink) Write(p []byte) (int, error)

Write writes one packet to the internal buffers

type TagRing

type TagRing struct {
	// contains filtered or unexported fields
}

func NewTagRing

func NewTagRing(cap int, t TagRingType) *TagRing

func (*TagRing) Read

func (tr *TagRing) Read(p []byte) (int, error)

Read decodes the value of the current ring buffer to a byte slice

func (*TagRing) Replace

func (tr *TagRing) Replace(ndx int, p []byte) error

Replace injects a byte slice into a position in the ring.

func (*TagRing) Reset

func (tr *TagRing) Reset()

func (*TagRing) Seek

func (tr *TagRing) Seek(ndx int) *TagBuffer

func (*TagRing) Write

func (tr *TagRing) Write(p []byte) (int, error)

Write encodes a byte slice to the current ring buffer

type TagRingType

type TagRingType uint8
const (
	TransmitType TagRingType = 0
	ReceiveType  TagRingType = 1
)

type TagStats

type TagStats struct {
	RxErrors      uint32
	TxErrors      uint32
	AwsRequests   uint32
	UpdatedTxTags uint32
	DeletedRxTags uint32
}

TagStats captures data on packets sent or received in AWS Lambda tags

Jump to

Keyboard shortcuts

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