time

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDuration

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

ParseDuration parses the given string and returns a numeric Duration. The format of the string must be consistent with that expected by the Mesos stout library; the string should consist of two parts, a floating-point numeric followed by a unit (no spaces in between). The following units are recognized: "ns", "us", "ms", "secs", "mins", "hrs", "days", "weeks". Examples of valid input strings are "10ns" and "1.5days". see https://github.com/apache/mesos/blob/4d2b1b793e07a9c90b984ca330a3d7bc9e1404cc/3rdparty/libprocess/3rdparty/stout/include/stout/duration.hpp

Types

type FormatError

type FormatError struct {
	Duration string
}

FormatError is generated when an invalid duration string is parsed; the format of the duration string is completely unrecognized in this case.

func (*FormatError) Error

func (fe *FormatError) Error() string

type UnitError

type UnitError struct {
	Unit string
}

UnitError is generated when an unknown unit is parsed from a duration string

func (*UnitError) Error

func (ue *UnitError) Error() string

Jump to

Keyboard shortcuts

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