Documentation
¶
Index ¶
- Variables
- func CalculateBlocks(totalSize, blockSize int) (blocks int)
- func GetFirstMatchedString(re *regexp.Regexp, source string) (string, bool)
- func LastSubstring(s string, sep string) string
- func ParseSeconds(interval string) (int, error)
- func ParseSize(fileSize string) (int, error)
- func ShortSourceLoc(skip int) (fileName string, line int, funcName string, ok bool)
- func SourceLoc(skip int) (file string, line int, funcName string, ok bool)
- func TrimBytes(bs []byte) []byte
- func ZipCompress(sourceFile, archiveFile string) error
- type RateLimiter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MinuteSeconds seconds of one minute MinuteSeconds = 60 // HourSeconds seconds of one hour HourSeconds = 60 * MinuteSeconds // DaySeconds seconds of one day DaySeconds = 24 * HourSeconds // KBytes size of k KBytes = 1024 // MBytes size of m MBytes = 1024 * KBytes // GBytes size of g GBytes = 1024 * MBytes // ErrTimeParse time parse error ErrTimeParse = errors.New("time parse error") // ErrSizeParse size parse error ErrSizeParse = errors.New("file size parse error") )
Functions ¶
func CalculateBlocks ¶
func GetFirstMatchedString ¶
func LastSubstring ¶
func ShortSourceLoc ¶
func ZipCompress ¶
Types ¶
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
func NewRateLimiter ¶
func NewRateLimiter(rate, intervalMillis int64) *RateLimiter
func (*RateLimiter) Allowable ¶
func (rl *RateLimiter) Allowable() bool