Documentation ¶
Index ¶
Constants ¶
const ( // ErrFull indicates that more outstanding messages await publishing than // the internal structure of the Collecter can support; the message passed // to Accept will not be published. ErrFull = constError("publish queue is full") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collecter ¶
type Collecter struct {
// contains filtered or unexported fields
}
Collecter receives incoming layers.SIP messages, discarding those that don't match the configured filter, and then publishes the accepted ones. It uses an internal channel to queue so that Accept won't block, making it suitable for use in a capture loop driven by gopacket.
func NewCollecter ¶
NewCollecter returns a Collecter that accepts messages that pass the match filter, then uses publish to emit them. depth controls how many messages may be internally queued before discarding excess.
func (*Collecter) Accept ¶
Accept receives an incoming SIP message and enqueues it for filtering and publishing. If for any reason the internal channel used for queueing is full, it will discard the message and return an error.
func (*Collecter) Metrics ¶
func (c *Collecter) Metrics() []prometheus.Collector
Metrics returns a list of prometheus.Collecter interfaces, suitable for passing to prometheus.Registry to export message collection metrics.
type Metrics ¶
type Metrics struct { Filter *prometheus.GaugeVec Rejected prometheus.Counter Published prometheus.Counter Dropped prometheus.Counter }
Metrics contains Prometheus metrics about SIP filtering, including the current filter and how many messages have been rejected and published.
func (Metrics) List ¶
func (m Metrics) List() []prometheus.Collector
List the items contained with a metrics so they can be exposed via a prometheus.Registry.