Help us shape the future of Go! Take the 2026 Go Developer Survey

util

package
v0.14.16 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: Apache-2.0 Imports: 7 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseURL added in v0.13.11

func ParseURL(urlStr string) (*url.URL, error)

func SchemeAndAddress added in v0.13.1

func SchemeAndAddress(str string) (string, string)

SchemeAndAddress crudely splits a URL string into scheme and address, where the address includes everything after the scheme/authority separator.

func UntilWithContext added in v0.14.12

func UntilWithContext(ctx context.Context, interval time.Duration, f func(context.Context), sliding bool)

UntilWithContext loops until context is done, running f every period. If sliding is true, the period starts after f completes. if sliding is false, the period starts before f is called, so functions that take longer than period to execute may be re-run again immediately.

Types

type BackoffManager added in v0.14.12

type BackoffManager interface {
	Backoff() *time.Timer
}

BackoffManager is a simple interval manager with timer reuse, inpsired by k8s.io/apimachinery/util/wait.BackoffManager.

func NewBackoffManager added in v0.14.12

func NewBackoffManager(step time.Duration) BackoffManager

NewBackoffManager returns a simple fixed-step timer

type Stripped

type Stripped string

Stripped wraps a string, stripping newlines and collapsing whitespace

func (Stripped) String

func (s Stripped) String() string

type Summarize added in v0.14.9

type Summarize []any

Summarize wraps a slice of any, and when stringed only prints the type/length of complex arguments

func (Summarize) String added in v0.14.9

func (s Summarize) String() string

Jump to

Keyboard shortcuts

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