Versions in this module Expand all Collapse all v1 v1.0.1 May 27, 2025 Changes in this version + var ErrLockerLocked = errors.Sentinel("locker: cannot acquire lock, already locked") + var Version = "develop" + func FirstNotEmpty(v ...string) string + func FormatBytes[T int | int16 | int32 | int64 | uint | uint16 | uint32 | uint64](b T) string + func GetDockerInfo(ctx context.Context) (types.Version, system.Info, error) + func MustInt(v string) int + func ScanReader(r io.Reader, callback func(line []byte)) error + type Atomic struct + func NewAtomic[T any](v T) *Atomic[T] + func (a *Atomic[T]) Load() T + func (a *Atomic[T]) MarshalJSON() ([]byte, error) + func (a *Atomic[T]) Store(v T) + func (a *Atomic[T]) UnmarshalJSON(b []byte) error + type AtomicBool struct + func NewAtomicBool(v bool) *AtomicBool + func (ab *AtomicBool) Load() bool + func (ab *AtomicBool) MarshalJSON() ([]byte, error) + func (ab *AtomicBool) Store(v bool) + func (ab *AtomicBool) SwapIf(v bool) bool + func (ab *AtomicBool) UnmarshalJSON(b []byte) error + type AtomicString struct + func NewAtomicString(v string) *AtomicString + func (as *AtomicString) Load() string + func (as *AtomicString) MarshalJSON() ([]byte, error) + func (as *AtomicString) Store(v string) + func (as *AtomicString) UnmarshalJSON(b []byte) error + type DiskInfo struct + Device string + Mountpoint string + Tags []string + TotalSpace uint64 + UsedSpace uint64 + type DockerCgroups struct + Driver string + Version string + type DockerContainers struct + Paused int + Running int + Stopped int + Total int + type DockerDiskUsage struct + BuildCacheSize int64 + ContainersSize int64 + ImagesActive int64 + ImagesSize int64 + ImagesTotal int + func GetDockerDiskUsage(ctx context.Context) (*DockerDiskUsage, error) + type DockerInformation struct + Cgroups DockerCgroups + Containers DockerContainers + Runc DockerRunc + Storage DockerStorage + Version string + type DockerRunc struct + Version string + type DockerStorage struct + Driver string + Filesystem string + type Information struct + Docker DockerInformation + System System + Version string + func GetSystemInformation() (*Information, error) + type Locker struct + func NewLocker() *Locker + func (l *Locker) Acquire() error + func (l *Locker) Destroy() + func (l *Locker) IsLocked() bool + func (l *Locker) Release() + func (l *Locker) TryAcquire(ctx context.Context) error + type Rate struct + func NewRate(limit uint64, duration time.Duration) *Rate + func (r *Rate) Reset() + func (r *Rate) Try() bool + type SinkName string + const InstallSink + const LogSink + type SinkPool struct + func NewSinkPool() *SinkPool + func (p *SinkPool) Destroy() + func (p *SinkPool) Off(c chan []byte) + func (p *SinkPool) On(c chan []byte) + func (p *SinkPool) Push(data []byte) + type System struct + Architecture string + CPUThreads int + KernelVersion string + MemoryBytes int64 + OS string + OSType string + type Utilization struct + CpuMax float64 + CpuPercent float64 + DiskDetails []DiskInfo + DiskTotal uint64 + DiskUsed uint64 + LoadAvg1 float64 + LoadAvg15 float64 + LoadAvg5 float64 + MemoryTotal uint64 + MemoryUsed uint64 + SwapTotal uint64 + SwapUsed uint64 + func GetSystemUtilization(root, logs, data, archive, backup, temp string) (*Utilization, error)