tstime

package
v1.38.4 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: BSD-3-Clause Imports: 8 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.RFC3339, s).

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.

func Sleep added in v1.38.0

func Sleep(ctx context.Context, d time.Duration) bool

Sleep is like time.Sleep but returns early upon context cancelation. It reports whether the full sleep duration was achieved.

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