Source File
sender_option.go
Belonging Package
github.com/pion/interceptor/pkg/report
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage reportimport ()// SenderOption can be used to configure SenderInterceptor.type SenderOption func(r *SenderInterceptor) error// SenderLog sets a logger for the interceptor.func ( logging.LeveledLogger) SenderOption {return func( *SenderInterceptor) error {.log =return nil}}// SenderInterval sets send interval for the interceptor.func ( time.Duration) SenderOption {return func( *SenderInterceptor) error {.interval =return nil}}// SenderNow sets an alternative for the time.Now function.func ( func() time.Time) SenderOption {return func( *SenderInterceptor) error {.now =return nil}}// SenderTicker sets an alternative for the time.NewTicker function.func ( TickerFactory) SenderOption {return func( *SenderInterceptor) error {.newTicker =return nil}}// SenderUseLatestPacket sets the interceptor to always use the latest packet, even// if it appears to be out-of-order.func () SenderOption {return func( *SenderInterceptor) error {.useLatestPacket = truereturn nil}}// enableStartTracking is used by tests to synchronize whether the loop() has begun// and it's safe to start sending ticks to the ticker.func enableStartTracking( chan struct{}) SenderOption {return func( *SenderInterceptor) error {.started =return nil}}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |