Documentation ¶
Index ¶
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) *LimitReader
NewLimitReader creates a LimitReader. src: reader rate: bytes/second
func NewLimitReaderWithLimiter ¶
func NewLimitReaderWithLimiter(rl *ratelimiter.RateLimiter, src io.Reader) *LimitReader
NewLimitReaderWithLimiter creates LimitReader with a rateLimiter. src: reader rate: bytes/second
func NewLimitReaderWithLimiterAndDigest ¶
func NewLimitReaderWithLimiterAndDigest(src io.Reader, rl *ratelimiter.RateLimiter, digest hash.Hash, digestType digest.Algorithm) *LimitReader
NewLimitReaderWithLimiterAndDigest creates LimitReader with rateLimiter and digest. src: reader rate: bytes/second
func (*LimitReader) Digest ¶
func (lr *LimitReader) Digest() string
Digest calculates the digest of all contents read, return value is like <algo>:<hex_value>
Click to show internal directories.
Click to hide internal directories.