units

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteSize

type ByteSize uint64

ByteSize is an uint64 with unmarshaling from human readable string. It doesn't support the default & validate tag 😰.

func (*ByteSize) UnmarshalJSON

func (b *ByteSize) UnmarshalJSON(jz []byte) (err error)

func (*ByteSize) UnmarshalYAML

func (b *ByteSize) UnmarshalYAML(n *yaml.Node) (err error)

type Duration

type Duration time.Duration

func ParseDuration

func ParseDuration(s string) (Duration, error)

ParseDuration parses a string format of the duration

func (*Duration) D

func (d *Duration) D() time.Duration

D returns time.Duration conversion of this.

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

UnmarshalJSON handles a string representation of time.Duration. e.g., 3s, 2m

func (*Duration) UnmarshalYAML

func (d *Duration) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML unmarshals a string node as time.Duration

Jump to

Keyboard shortcuts

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