-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
review fixes, rename receiver -> generator, sender -> responder, lint…
…er fixes
- Loading branch information
Showing
13 changed files
with
240 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package nack | ||
|
||
import "errors" | ||
|
||
var ( | ||
// ErrInvalidSize is returned by newReceiveLog/newSendBuffer, when an incorrect buffer size is supplied. | ||
ErrInvalidSize = errors.New("invalid buffer size") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package nack | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/pion/logging" | ||
) | ||
|
||
// GeneratorOption can be used to configure GeneratorInterceptor | ||
type GeneratorOption func(r *GeneratorInterceptor) | ||
|
||
// GeneratorSize sets the size of the interceptor. | ||
// Size must be one of: 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768 | ||
func GeneratorSize(size uint16) GeneratorOption { | ||
return func(r *GeneratorInterceptor) { | ||
r.size = size | ||
} | ||
} | ||
|
||
// GeneratorSkipLastN sets the number of packets (n-1 packets before the last received packets) to ignore when generating | ||
// nack requests. | ||
func GeneratorSkipLastN(skipLastN uint16) GeneratorOption { | ||
return func(r *GeneratorInterceptor) { | ||
r.skipLastN = skipLastN | ||
} | ||
} | ||
|
||
// GeneratorLog sets a logger for the interceptor | ||
func GeneratorLog(log logging.LeveledLogger) GeneratorOption { | ||
return func(r *GeneratorInterceptor) { | ||
r.log = log | ||
} | ||
} | ||
|
||
// GeneratorInterval sets the nack send interval for the interceptor | ||
func GeneratorInterval(interval time.Duration) GeneratorOption { | ||
return func(r *GeneratorInterceptor) { | ||
r.interval = interval | ||
} | ||
} |
Oops, something went wrong.