units

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDuration added in v0.2.0

func ParseDuration(s string) (time.Duration, error)

ParseDuration parses a duration string with support for days (d) and weeks (w) in addition to Go's standard duration units (ns, us, ms, s, m, h). Examples: "7d", "2w", "24h", "168h", "30m"

Types

type Bytes

type Bytes int64

func (Bytes) Bytes

func (b Bytes) Bytes() Bytes

func (Bytes) GigaBytes

func (b Bytes) GigaBytes() GigaBytes

func (Bytes) Int64

func (b Bytes) Int64() int64

func (Bytes) KiloBytes

func (b Bytes) KiloBytes() KiloBytes

func (Bytes) MegaBytes

func (b Bytes) MegaBytes() MegaBytes

func (Bytes) Short

func (b Bytes) Short() string

func (Bytes) String

func (b Bytes) String() string

type Data

type Data interface {
	Bytes() Bytes
	Short() string
	String() string
}

func ParseData

func ParseData(str string) (Data, error)

type Days

type Days int32

type GigaBytes

type GigaBytes int64

func (GigaBytes) Bytes

func (g GigaBytes) Bytes() Bytes

func (GigaBytes) Int64

func (g GigaBytes) Int64() int64

func (GigaBytes) KiloBytes

func (g GigaBytes) KiloBytes() KiloBytes

func (GigaBytes) MegaBytes

func (g GigaBytes) MegaBytes() MegaBytes

func (GigaBytes) Short

func (g GigaBytes) Short() string

func (GigaBytes) String

func (g GigaBytes) String() string

type KiloBytes

type KiloBytes int64

func (KiloBytes) Bytes

func (k KiloBytes) Bytes() Bytes

func (KiloBytes) GigaBytes

func (k KiloBytes) GigaBytes() GigaBytes

func (KiloBytes) Int64

func (k KiloBytes) Int64() int64

func (KiloBytes) MegaBytes

func (k KiloBytes) MegaBytes() MegaBytes

func (KiloBytes) Short

func (k KiloBytes) Short() string

func (KiloBytes) String

func (k KiloBytes) String() string

type MegaBytes

type MegaBytes int64

func (MegaBytes) Bytes

func (m MegaBytes) Bytes() Bytes

func (MegaBytes) GigaBytes

func (m MegaBytes) GigaBytes() GigaBytes

func (MegaBytes) Int64

func (m MegaBytes) Int64() int64

func (MegaBytes) KiloBytes

func (m MegaBytes) KiloBytes() KiloBytes

func (MegaBytes) Short

func (m MegaBytes) Short() string

func (MegaBytes) String

func (m MegaBytes) String() string

type Microseconds

type Microseconds uint64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL