Documentation ¶
Index ¶
- Variables
- func Alloc(size int) []byte
- func AllocMemory() int64
- func Clock() time.Duration
- func DisableLogColor()
- func Exists(path string) bool
- func FormatBytes(n uint64) string
- func Free(b []byte)
- func GetDev(fpath string) int
- func GetFileInode(path string) (uint64, error)
- func GetKernelVersion() (major, minor int)
- func GetLocalIp(address string) (string, error)
- func GetLogger(name string) *logHandle
- func GuessMimeType(key string) string
- func InitLoggers(logToSyslog bool)
- func MemoryUsage() (virt, rss uint64)
- func Min(a, b int) int
- func MockProgress() (*Progress, *Bar)
- func Now() time.Time
- func RemovePassword(uri string) string
- func SetLogLevel(lvl logrus.Level)
- func SetOutFile(name string)
- func SetOutput(w io.Writer)
- func SleepWithJitter(d time.Duration)
- func SplitDir(d string) []string
- func StringContains(s []string, e string) bool
- func SupportANSIColor(fd uintptr) bool
- func WithTimeout(f func() error, timeout time.Duration) error
- type Bar
- type Buffer
- func (b *Buffer) Buffer() []byte
- func (b *Buffer) Bytes() []byte
- func (b *Buffer) Get(l int) []byte
- func (b *Buffer) Get16() uint16
- func (b *Buffer) Get32() uint32
- func (b *Buffer) Get64() uint64
- func (b *Buffer) Get8() uint8
- func (b *Buffer) HasMore() bool
- func (b *Buffer) Left() int
- func (b *Buffer) Len() int
- func (b *Buffer) Put(v []byte)
- func (b *Buffer) Put16(v uint16)
- func (b *Buffer) Put32(v uint32)
- func (b *Buffer) Put64(v uint64)
- func (b *Buffer) Put8(v uint8)
- func (b *Buffer) Seek(p int)
- func (b *Buffer) SetBytes(buf []byte)
- type Cond
- type DoubleSpinner
- type Progress
- func (p *Progress) AddByteSpinner(name string) *Bar
- func (p *Progress) AddCountBar(name string, total int64) *Bar
- func (p *Progress) AddCountSpinner(name string) *Bar
- func (p *Progress) AddDoubleSpinner(name string) *DoubleSpinner
- func (p *Progress) AddIoSpeedBar(name string, total int64) *Bar
- func (p *Progress) Done()
- type Rusage
- type SyslogHook
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ENOTSUP = errors.New("not supported")
)
Functions ¶
func DisableLogColor ¶
func DisableLogColor()
func FormatBytes ¶
func GetFileInode ¶
func GetKernelVersion ¶
func GetKernelVersion() (major, minor int)
func GetLocalIp ¶
GetLocalIp get the local ip used to access remote address.
func GuessMimeType ¶
func InitLoggers ¶
func InitLoggers(logToSyslog bool)
func MemoryUsage ¶
func MemoryUsage() (virt, rss uint64)
func MockProgress ¶
func RemovePassword ¶
func SetLogLevel ¶
SetLogLevel sets Level to all the loggers in the map
func SetOutFile ¶
func SetOutFile(name string)
func SleepWithJitter ¶
func StringContains ¶
func SupportANSIColor ¶
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer is a buffer to read/write integers.
func NewNativeBuffer ¶
NewNativeBuffer utility to create *Buffer of given size with nativeEndian
func ReadBuffer ¶
ReadBuffer utility to create *Buffer from slice of bytes
type Cond ¶
Cond is similar to sync.Cond, but you can wait with a timeout.
func (*Cond) Broadcast ¶
func (c *Cond) Broadcast()
Broadcast wake up all the waiters. It's required for the caller to hold L.
func (*Cond) Signal ¶
func (c *Cond) Signal()
Signal wakes up a waiter. It's required for the caller to hold L.
type DoubleSpinner ¶
type DoubleSpinner struct {
// contains filtered or unexported fields
}
func (*DoubleSpinner) Current ¶
func (s *DoubleSpinner) Current() (int64, int64)
func (*DoubleSpinner) Done ¶
func (s *DoubleSpinner) Done()
func (*DoubleSpinner) IncrInt64 ¶
func (s *DoubleSpinner) IncrInt64(size int64)
func (*DoubleSpinner) SetCurrent ¶
func (s *DoubleSpinner) SetCurrent(count, bytes int64)
type Progress ¶
type Progress struct { *mpb.Progress Quiet bool // contains filtered or unexported fields }
func NewProgress ¶
func (*Progress) AddByteSpinner ¶
func (*Progress) AddCountSpinner ¶
func (*Progress) AddDoubleSpinner ¶
func (p *Progress) AddDoubleSpinner(name string) *DoubleSpinner
type SyslogHook ¶
type SyslogHook struct {
*logrus_syslog.SyslogHook
}
Click to show internal directories.
Click to hide internal directories.