duration

package
v0.0.0-...-fa720cf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Duration

type Duration time.Duration

Duration is a wrapper type for time.Duration which provides human-friendly text (un)marshaling. See https://github.com/golang/go/issues/16039

func (Duration) MarshalText

func (d Duration) MarshalText() (text []byte, err error)

MarshalText converts a duration to text.

func (*Duration) Set

func (d *Duration) Set(raw string) error

Set sets the duration from the given string. Implements the pflag.Value interface.

func (*Duration) String

func (d *Duration) String() string

String returns the string representation of the duration.

func (*Duration) Type

func (d *Duration) Type() string

Type returns the name of this type. Implements the pflag.Value interface.

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) error

UnmarshalText parses text into a duration value.

Jump to

Keyboard shortcuts

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