Documentation ¶
Index ¶
- type LimitReader
- func NewLimitReader(src io.Reader, rate int64, calculateMd5 bool) *LimitReader
- func NewLimitReaderWithLimiter(rl *ratelimiter.RateLimiter, src io.Reader, calculateMd5 bool) *LimitReader
- func NewLimitReaderWithLimiterAndMD5Sum(src io.Reader, rl *ratelimiter.RateLimiter, md5sum hash.Hash) *LimitReader
- func NewLimitReaderWithMD5Sum(src io.Reader, rate int64, md5sum hash.Hash) *LimitReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LimitReader ¶
type LimitReader struct { Src io.Reader Limiter *ratelimiter.RateLimiter // contains filtered or unexported fields }
LimitReader reads stream with RateLimiter.
func NewLimitReader ¶
func NewLimitReader(src io.Reader, rate int64, calculateMd5 bool) *LimitReader
NewLimitReader creates a LimitReader. src: reader rate: bytes/second
func NewLimitReaderWithLimiter ¶
func NewLimitReaderWithLimiter(rl *ratelimiter.RateLimiter, src io.Reader, calculateMd5 bool) *LimitReader
NewLimitReaderWithLimiter creates LimitReader with a rateLimiter. src: reader rate: bytes/second
func NewLimitReaderWithLimiterAndMD5Sum ¶
func NewLimitReaderWithLimiterAndMD5Sum(src io.Reader, rl *ratelimiter.RateLimiter, md5sum hash.Hash) *LimitReader
NewLimitReaderWithLimiterAndMD5Sum creates LimitReader with rateLimiter and md5 sum. src: reader rate: bytes/second
func NewLimitReaderWithMD5Sum ¶
NewLimitReaderWithMD5Sum creates LimitReader with a md5 sum. src: reader rate: bytes/second
func (*LimitReader) Md5 ¶
func (lr *LimitReader) Md5() string
Md5 calculates the md5 of all contents read.
Click to show internal directories.
Click to hide internal directories.