Documentation ¶
Index ¶
- Variables
- func Alloc(size int) []byte
- func AllocMemory() int64
- func Clock() time.Duration
- func DisableLogColor()
- func Exists(path string) bool
- func FindLocalIPs() ([]net.IP, error)
- func FormatBytes(n uint64) string
- func Free(b []byte)
- func GetDev(fpath string) int
- func GetFileInode(path string) (uint64, error)
- func GetKernelInfo() (string, error)
- func GetKernelVersion() (major, minor int)
- func GetLocalIp(address string) (string, error)
- func GetLogger(name string) *logHandle
- func GetSysInfo() string
- func GetUmask() int
- func GroupName(gid int) string
- func GuessMimeType(key string) string
- func InitLoggers(logToSyslog bool)
- func LookupGroup(name string) int
- func LookupUser(name string) int
- 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 UserName(uid int) string
- 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) AddDoubleSpinnerTwo(countName, sizeName 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")
)
View Source
var NativeEndian binary.ByteOrder
Functions ¶
func AllocMemory ¶ added in v0.16.1
func AllocMemory() int64
AllocMemory returns the allocated memory
func DisableLogColor ¶ added in v1.0.0
func DisableLogColor()
func FindLocalIPs ¶ added in v1.1.0
func FormatBytes ¶ added in v1.0.0
func GetFileInode ¶ added in v0.11.0
func GetKernelInfo ¶ added in v1.1.0
func GetKernelVersion ¶ added in v1.0.0
func GetKernelVersion() (major, minor int)
func GetLocalIp ¶ added in v1.0.0
GetLocalIp get the local ip used to access remote address.
func GetSysInfo ¶ added in v1.1.0
func GetSysInfo() string
func GuessMimeType ¶ added in v1.0.0
func InitLoggers ¶
func InitLoggers(logToSyslog bool)
func LookupGroup ¶ added in v1.1.0
func LookupUser ¶ added in v1.1.0
func MemoryUsage ¶ added in v0.11.0
func MemoryUsage() (virt, rss uint64)
func MockProgress ¶ added in v1.0.0
func RemovePassword ¶ added in v1.0.0
func SetLogLevel ¶
SetLogLevel sets Level to all the loggers in the map
func SetOutFile ¶ added in v0.13.0
func SetOutFile(name string)
func SleepWithJitter ¶ added in v1.0.0
func StringContains ¶ added in v1.0.0
func SupportANSIColor ¶ added in v1.0.1
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.
type DoubleSpinner ¶ added in v1.0.0
type DoubleSpinner struct {
// contains filtered or unexported fields
}
func (*DoubleSpinner) Current ¶ added in v1.0.0
func (s *DoubleSpinner) Current() (int64, int64)
func (*DoubleSpinner) Done ¶ added in v1.0.0
func (s *DoubleSpinner) Done()
func (*DoubleSpinner) IncrInt64 ¶ added in v1.0.0
func (s *DoubleSpinner) IncrInt64(size int64)
func (*DoubleSpinner) SetCurrent ¶ added in v1.0.0
func (s *DoubleSpinner) SetCurrent(count, bytes int64)
type Progress ¶ added in v1.0.0
type Progress struct { *mpb.Progress Quiet bool // contains filtered or unexported fields }
func NewProgress ¶ added in v1.0.0
func (*Progress) AddByteSpinner ¶ added in v1.0.0
func (*Progress) AddCountBar ¶ added in v1.0.0
func (*Progress) AddCountSpinner ¶ added in v1.0.0
func (*Progress) AddDoubleSpinner ¶ added in v1.0.0
func (p *Progress) AddDoubleSpinner(name string) *DoubleSpinner
func (*Progress) AddDoubleSpinnerTwo ¶ added in v1.1.0
func (p *Progress) AddDoubleSpinnerTwo(countName, sizeName string) *DoubleSpinner
func (*Progress) AddIoSpeedBar ¶ added in v1.0.0
type Rusage ¶ added in v0.11.0
func GetRusage ¶ added in v0.11.0
func GetRusage() *Rusage
GetRusage returns CPU usage of current process.
type SyslogHook ¶
type SyslogHook struct { *logrus_syslog.SyslogHook // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.