tstime

package
v0.0.0-...-ded95ce Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

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

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

Parse3339B is Parse3339 but for byte slices.

func ParseDuration

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

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

func RandomDurationBetween

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