Documentation ¶
Overview ¶
Package signal provides handling notifications from perf RB signal map.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFullChannel = errors.New("full channel") ErrNilChannel = errors.New("nil channel") ErrRuntimeRegistration = errors.New("runtime registration not supported") ErrNoHandlers = errors.New("no registered signal handlers") )
View Source
var Cell = cell.Module( "signal", "Receive signals from datapath and distribute them to registered channels", cell.Provide(provideSignalManager), )
Cell initializes and manages the signal manager.
Functions ¶
This section is empty.
Types ¶
type SignalHandler ¶
SignalHandler parses signal data from the perf message via a reader. Signal handler functions are only ever called from a single goroutine. A nil reader is passed when the handler is closed. Returns low-cardinality representation of the signal data to be used in a metric.
func ChannelHandler ¶
func ChannelHandler[T fmt.Stringer](ch chan<- T) SignalHandler
ChannelHandler is a generic function returning a SignalHandler that writes data from a reader to the channel.
type SignalManager ¶
type SignalManager interface { // RegisterHandler must be called during initialization of the cells using signals. RegisterHandler(handler SignalHandler, signals ...SignalType) error MuteSignals(signals ...SignalType) error UnmuteSignals(signals ...SignalType) error }
type SignalType ¶
type SignalType uint32
const ( // SignalNatFillUp denotes potential congestion on the NAT table SignalNatFillUp SignalType = iota // SignalCTFillUp denotes potential congestion on the CT table SignalCTFillUp // SignalAuthRequired denotes a connection dropped due to missing authentication SignalAuthRequired SignalTypeMax )
Click to show internal directories.
Click to hide internal directories.