tstime

package
v1.36.1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: BSD-3-Clause Imports: 10 Imported by: 26

Documentation

Overview

Package tstime defines Tailscale-specific time utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse3339

func Parse3339(s string) (time.Time, error)

Parse3339 is a wrapper around time.Parse(time.RFC3339Nano, s) that caches timezone Locations for future parses.

func Parse3339B added in v1.4.0

func Parse3339B(b []byte) (time.Time, error)

Parse3339B is Parse3339 but for byte slices.

func ParseDuration added in v1.32.0

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

ParseDuration is more expressive than time.ParseDuration, also accepting 'd' (days) and 'w' (weeks) literals.

func RandomDurationBetween added in v1.4.0

func RandomDurationBetween(min, max time.Duration) time.Duration

RandomDurationBetween returns a random duration in range [min,max). If panics if max < min.

Types

This section is empty.

Directories

Path Synopsis
Package mono provides fast monotonic time.
Package mono provides fast monotonic time.
Package rate provides a rate limiter.
Package rate provides a rate limiter.

Jump to

Keyboard shortcuts

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