cache

package
v0.0.0-...-1a0e8e6 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheMeter

type CacheMeter struct {
	meters.ApiMeter
	// contains filtered or unexported fields
}

func (*CacheMeter) GetValue

func (m *CacheMeter) GetValue(meterName string, startTime time.Time, endTime time.Time, dims meters.Dimensions) (float64, bool)

type CacheMeterData

type CacheMeterData struct {
	Value float64
}

A simple value

type CacheMeterKey

type CacheMeterKey struct {
	User      string
	MeterName string
	Start     int64
	End       int64
	Dims      string
}

CacheMeterKey should map to GetValue arguments

func (CacheMeterKey) String

func (c CacheMeterKey) String() string

type CacheMeterProvider

type CacheMeterProvider struct {
	meters.MeterProvider
	// contains filtered or unexported fields
}

Wraps a meter with caching

func NewCacheMeterProvider

func NewCacheMeterProvider(provider meters.MeterProvider, topic string, redisClient *redis.Client, recheck time.Duration, expires time.Duration, refresh time.Duration) *CacheMeterProvider

func (*CacheMeterProvider) GetValue

func (m *CacheMeterProvider) GetValue(user meters.MeterUser, meterName string, startTime time.Time, endTime time.Time, dims meters.Dimensions) (float64, bool)

func (*CacheMeterProvider) NewMeter

Jump to

Keyboard shortcuts

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