types

package module
v0.0.0-...-c5aab59 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const Day = time.Hour * 24

Variables

This section is empty.

Functions

This section is empty.

Types

type Duration

type Duration int64

func ParseDuration

func ParseDuration(s string) (Duration, error)

ParseDuration parses a duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

func (Duration) Days

func (d Duration) Days() float64

func (Duration) Go

func (d Duration) Go() time.Duration

func (Duration) Int

func (d Duration) Int() int64

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (Duration) MarshalYAML

func (d Duration) MarshalYAML() (interface{}, error)

func (*Duration) Scan

func (d *Duration) Scan(value any) (err error)

Scan implements the Scanner interface.

func (Duration) String

func (d Duration) String() string

func (*Duration) UnmarshalJSON

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

func (*Duration) UnmarshalYAML

func (d *Duration) UnmarshalYAML(fn func(interface{}) error) error

func (Duration) Value

func (d Duration) Value() (driver.Value, error)

Value implements the driver Valuer interface.

Jump to

Keyboard shortcuts

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