You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
531 B
29 lines
531 B
2 years ago
|
// +build !go1.7
|
||
|
|
||
|
// "golang.org/x/time/rate" is depended on golang context package go1.7 onward
|
||
|
// this file is only for build,not supports limit upload speed
|
||
|
package oss
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"io"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
perTokenBandwidthSize int = 1024
|
||
|
)
|
||
|
|
||
|
type OssLimiter struct {
|
||
|
}
|
||
|
|
||
|
type LimitSpeedReader struct {
|
||
|
io.ReadCloser
|
||
|
reader io.Reader
|
||
|
ossLimiter *OssLimiter
|
||
|
}
|
||
|
|
||
|
func GetOssLimiter(uploadSpeed int) (ossLimiter *OssLimiter, err error) {
|
||
|
err = fmt.Errorf("rate.Limiter is not supported below version go1.7")
|
||
|
return nil, err
|
||
|
}
|