reports

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissedCache = errors.New("not in cache")

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Set(string, *tabulator.Tabulator) error
	Get(string) (*tabulator.Tabulator, error)
}

type LocalCache added in v1.16.0

type LocalCache struct {
	*cache.Cache[string, *tabulator.Tabulator]
}

LocalCache caches the different reports generated by the server

func NewLocalCache added in v1.16.0

func NewLocalCache(expiration time.Duration) *LocalCache

func (*LocalCache) Get added in v1.16.0

func (cache *LocalCache) Get(key string) (*tabulator.Tabulator, error)

func (*LocalCache) Set added in v1.16.0

func (cache *LocalCache) Set(key string, table *tabulator.Tabulator) error

type MemCache added in v1.16.0

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

func NewMemCache added in v1.16.0

func NewMemCache(m MemCacheClient, expiration time.Duration) *MemCache

func (*MemCache) Get added in v1.16.0

func (m *MemCache) Get(key string) (*tabulator.Tabulator, error)

func (*MemCache) Set added in v1.16.0

func (m *MemCache) Set(key string, table *tabulator.Tabulator) error

type MemCacheClient added in v1.16.0

type MemCacheClient interface {
	Get(string) (*memcache.Item, error)
	Set(*memcache.Item) error
}

type ReportCache added in v1.16.0

type ReportCache struct {
	Cache
	// contains filtered or unexported fields
}

func (*ReportCache) MaybeGenerate added in v1.16.0

func (c *ReportCache) MaybeGenerate(key string, generate func() (*tabulator.Tabulator, error)) (*tabulator.Tabulator, error)

MaybeGenerate loads a report from LocalCache, or generates it if the report does not exist or is expired

func (*ReportCache) Stats added in v1.16.0

func (c *ReportCache) Stats() map[string]int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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