Documentation
¶
Overview ¶
Package pacing implements a pacing interceptor.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interceptor ¶
type Interceptor struct {
interceptor.NoOp
// contains filtered or unexported fields
}
Interceptor implements packet pacing using a token bucket filter and sends packets at a fixed interval.
func (*Interceptor) BindLocalStream ¶
func (i *Interceptor) BindLocalStream( info *interceptor.StreamInfo, writer interceptor.RTPWriter, ) interceptor.RTPWriter
BindLocalStream implements interceptor.Interceptor.
func (*Interceptor) Close ¶
func (i *Interceptor) Close() error
Close implements interceptor.Interceptor.
type InterceptorFactory ¶
type InterceptorFactory struct {
// contains filtered or unexported fields
}
InterceptorFactory is a factory for pacing interceptors. It also keeps a map of interceptors created in the past by ID.
func NewInterceptor ¶
func NewInterceptor(opts ...Option) *InterceptorFactory
NewInterceptor returns a new InterceptorFactory.
func (*InterceptorFactory) NewInterceptor ¶
func (f *InterceptorFactory) NewInterceptor(id string) (interceptor.Interceptor, error)
NewInterceptor creates a new pacing interceptor.
func (*InterceptorFactory) SetRate ¶
func (f *InterceptorFactory) SetRate(id string, r int)
SetRate updates the pacing rate of the pacing interceptor with the given ID.
type Option ¶
type Option func(*Interceptor) error
Option is a configuration option for pacing interceptors.
func InitialRate ¶
InitialRate configures the initial pacing rate for interceptors created by the interceptor factory.
func Interval ¶
Interval configures the pacing interval for interceptors created by the interceptor factory.
func WithLoggerFactory ¶
func WithLoggerFactory(loggerFactory logging.LoggerFactory) Option
WithLoggerFactory sets a logger factory for the interceptor.