refresher

package
v0.0.0-...-cbdeaad Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OnErrorLog

func OnErrorLog(logger *log.Logger) func(error, time.Time)

Types

type HandlerFunc

type HandlerFunc[T any] func(context.Context) (T, error)

type Refresher

type Refresher[T any] struct {
	Logger *log.Logger
	// contains filtered or unexported fields
}

func NewRefresher

func NewRefresher[T any](logger *log.Logger, tickerDuration time.Duration, handler HandlerFunc[T], onErrorFunc func(error, time.Time)) *Refresher[T]

func (*Refresher[T]) Data

func (r *Refresher[T]) Data(ctx context.Context) T

func (*Refresher[T]) Stop

func (r *Refresher[T]) Stop()

Jump to

Keyboard shortcuts

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