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

utils

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add added in v0.6.0

func Add(m map[string]string, key, value string) map[string]string

Add adds to the given map the given key mapped to the given value.

Types

type ExpiringCache added in v0.9.0

type ExpiringCache interface {
	// Get looks up an entry in the cache.
	Get(key interface{}) (value interface{}, ok bool)
	// Set sets a key/value/ttl entry in the cache, overwriting any previous entry with the same key.
	Set(key interface{}, value interface{}, ttl time.Duration)
	// Delete deletes an entry from the cache.
	Delete(key interface{})
}

ExpiringCache is a map whose entries expire after a per-entry timeout.

type Timestamper

type Timestamper interface {
	// Now returns the current local time.
	Now() metav1.Time
}

Timestamper provides a function for getting the current local time.

type TimestamperFunc

type TimestamperFunc func() metav1.Time

TimestamperFunc is a function that implements Timestamper, e.g. metav1.Now().

func (TimestamperFunc) Now

func (f TimestamperFunc) Now() metav1.Time

Now returns the current local time.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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