timercache

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 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 TimerCache

type TimerCache[T any] struct {
	Refresh func() T
	// contains filtered or unexported fields
}

func Build

func Build[T any](expired time.Duration, refresh func() T) *TimerCache[T]

func (*TimerCache[T]) GetData

func (h *TimerCache[T]) GetData() *T

func (*TimerCache[T]) GetInterval

func (h *TimerCache[T]) GetInterval() time.Duration

func (*TimerCache[T]) GetOnce

func (h *TimerCache[T]) GetOnce() bool

func (*TimerCache[T]) Start

func (h *TimerCache[T]) Start()

func (*TimerCache[T]) Stop

func (h *TimerCache[T]) Stop()

func (*TimerCache[T]) TryGetData

func (h *TimerCache[T]) TryGetData(timeout time.Duration) *T

func (*TimerCache[T]) Update

func (h *TimerCache[T]) Update()

Jump to

Keyboard shortcuts

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