atomic

package
v1.4.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache[T any] struct {
	// contains filtered or unexported fields
}

func MakeCache

func MakeCache[T any](val T) Cache[T]

func (*Cache[T]) Get

func (c *Cache[T]) Get(create func() T) T

func (*Cache[T]) Set

func (c *Cache[T]) Set(val T)

func (*Cache[T]) TryGet

func (c *Cache[T]) TryGet(create func() (T, error)) (T, error)

func (*Cache[T]) UnsafePurge

func (c *Cache[T]) UnsafePurge()

UnsafePurge resets cache value. The function is not goroutine safe and shall not be used in production code

Jump to

Keyboard shortcuts

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