util

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package util provides various utility functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Remember

type Remember[T any] interface {
	// Get returns nil if nothing is remembered or it has expired
	Get() *T
	// Update sets the thing to be remembered
	Update(*T)
	// Forget clears the thing that was remembered
	Forget()
}

Remember stores an item for a period of time. It is safe to share with multiple goroutines.

func NewRemember

func NewRemember[T any](duration time.Duration) Remember[T]

NewRemember creates an implementation of Remembered with the specified duration to remember the item

type UnboundedChan added in v0.5.2

type UnboundedChan[T any] interface {
	In() chan<- T
	Out() <-chan T
	Close()
}

UnboundedChan is a channel with an unbounded buffer

func NewUnboundedChan added in v0.5.2

func NewUnboundedChan[T any](interval time.Duration) UnboundedChan[T]

NewUnboundedChan creates a new unbounded channel

Directories

Path Synopsis
Package semver provides a model and functions for working with semantic versions.
Package semver provides a model and functions for working with semantic versions.

Jump to

Keyboard shortcuts

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