updatecache

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomicBool

type AtomicBool struct {
	// contains filtered or unexported fields
}

atomicBool is a wrapper around uint32 for usage as a boolean value with atomic access.

func NewAtomicBool

func NewAtomicBool(flag bool) *AtomicBool

func (*AtomicBool) IsSet

func (ab *AtomicBool) IsSet() bool

IsSet returns whether the current boolean value is true

func (*AtomicBool) IsTrue

func (ab *AtomicBool) IsTrue() bool

func (*AtomicBool) Set

func (ab *AtomicBool) Set(value bool)

Set sets the value of the bool regardless of the previous value

type GetValueFunc

type GetValueFunc func() any

type Item

type Item struct {
	// contains filtered or unexported fields
}

func NewItem

func NewItem(key, value any) *Item

type LocalCache

type LocalCache struct {
	// contains filtered or unexported fields
}

func NewCache

func NewCache(waitUpdate bool) *LocalCache

func (*LocalCache) Get

func (c *LocalCache) Get(key any) any

func (*LocalCache) Set

func (c *LocalCache) Set(key any, value any, d time.Duration)

func (*LocalCache) UpdateAfter

func (c *LocalCache) UpdateAfter(key any, d time.Duration, f GetValueFunc)

use f to get value

Jump to

Keyboard shortcuts

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