expiry

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BadTime = time.Unix(666, 0)
)

Functions

func Days

func Days(days int) time.Time

func FromDate

func FromDate(base time.Time, s string) time.Time

func FromDateErr

func FromDateErr(base time.Time, s string) (time.Time, error)

FromDateErr parses a lease duration string. A lease duration string is a sequence of decimal numbers, each with optional fraction and a unit suffix, such as "10y", "1m10d", "1h30min", "300ms", "0" or "never". Valid time units are "y", "m", "d", "ms", "s", "min", "h". Fractions are not allowed for years, months and days. "never" or "0" means no expiry.

func FromNow

func FromNow(s string) time.Time

func Months

func Months(months int) time.Time

func Never

func Never() time.Time

func Years

func Years(years int) time.Time

Types

This section is empty.

Jump to

Keyboard shortcuts

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