streams

package
v0.0.0-...-e1d70f4 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Placeholder to identify the first loopback device (usually lo or lo0, depending on platform)
	LoopbackAbbr = "_first_loopback_"

	// Device flags used to identify a loopback device
	LoopbackFlags = net.FlagLoopback | net.FlagUp
)
View Source
const (
	// DefaultStatsDPort is the default port the StatsD daemon listens on
	DefaultStatsDPort = 8125
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// Listen begins reading metric datagrams off the network, sending the raw bytes to the data channel. This method
	// blocks until ctx is Done or an internal error arises.
	Listen(ctx context.Context) error

	// Chan returns the channel through which the raw datagrams will be returned. If the channel is closed, this stream
	// is no longer valid and a new one will need to be created.
	Chan() <-chan []byte
}

Interface describes a stream source for stats metrics

func ResolveStream

func ResolveStream(mode StreamMode, device string, port int) (stream Interface, err error)

type StreamMode

type StreamMode uint8
const (
	DefaultMode StreamMode = iota
	ListenMode
	CaptureMode
)

Jump to

Keyboard shortcuts

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