Documentation ¶
Index ¶
- Constants
- func FormatDuration(duration int64) string
- func FormatSize(size int64) string
- func GenerateToken(size int) (string, error)
- func Hash(w io.Reader) ([]byte, error)
- func ParseSize(size string) int64
- func SplitHash(str string) (string, error)
- func Stringify(v interface{}) string
- func ValidDirectoryName(name string) string
- type RateLimiter
Constants ¶
View Source
const ( B = 1 << (10 * iota) KB MB GB TB )
View Source
const ( Nanosecond = 1 Microsecond = 1000 * Nanosecond Millisecond = 1000 * Microsecond Second = 1000 * Millisecond Minute = 60 * Second Hour = 60 * Minute )
Variables ¶
This section is empty.
Functions ¶
func FormatDuration ¶
func FormatSize ¶
func GenerateToken ¶ added in v0.0.8
func ValidDirectoryName ¶
Types ¶
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
func NewRateLimiter ¶
func NewRateLimiter(tokenPreSecond int) *RateLimiter
func (*RateLimiter) Token ¶
func (r *RateLimiter) Token()
Click to show internal directories.
Click to hide internal directories.