cacheutil

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNewCacheable

func GetNewCacheable(
	fetcher func(key string) (Cacheable, error),
) func(key string) (interface{}, *time.Duration, error)

GetNewCacheable uses fetcher function to retrieve object.

func MakeCache

func MakeCache(fetcher func(key string) (interface{}, *time.Duration, error)) gcache.Cache

MakeCache is helper function to create cache with string keys.

Types

type Cacheable

type Cacheable interface {
	CacheLifetime() (time.Duration, error)
}

Cacheable interface has to implemented by objects in the cache.

Jump to

Keyboard shortcuts

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