// SPDX-FileCopyrightText: 2023 The Pion community // SPDX-License-Identifier: MIT package report import ( "time" "github.com/pion/logging" ) // ReceiverOption can be used to configure ReceiverInterceptor. type CompoundReceiverOption func(r *CompoundReceiverInterceptor) error // ReceiverLog sets a logger for the interceptor. func CompoundReceiverLog(log logging.LeveledLogger) CompoundReceiverOption { return func(r *CompoundReceiverInterceptor) error { r.log = log return nil } } // ReceiverInterval sets send interval for the interceptor. func CompoundReceiverInterval(interval time.Duration) CompoundReceiverOption { return func(r *CompoundReceiverInterceptor) error { r.interval = interval return nil } } // ReceiverNow sets an alternative for the time.Now function. func CompoundReceiverNow(f func() time.Time) CompoundReceiverOption { return func(r *CompoundReceiverInterceptor) error { r.now = f return nil } } // QueueCompoundPacket puts the interceptor in compound mode - before each RR is sent, this function is called // and it returns a packet to add to the compound RR func CompoundReceiverQueueCompoundPacket(f CompoundPacketFunction) CompoundReceiverOption { return func(r *CompoundReceiverInterceptor) error { r.packetQueueFn = &f return nil } }