gocache

package
v0.0.0-...-b36d24e Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: MulanPSL-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

View Source
const Cache_expire_time = 30 * time.Minute

Variables

View Source
var FileCache = NewFileCache()

Functions

func CacheGet

func CacheGet[T any](Key string) (*T, bool)

func CacheSet

func CacheSet[T any](Key string, object *T)

func Delete

func Delete[T any](Key string)

func FindMetaCacheSet

func FindMetaCacheSet[T any](value baseiface.IcacheKey) *T

func InjectIchubCache

func InjectIchubCache(s *IchubCache)

func InjectMetaCache

func InjectMetaCache(s *MetaCache)

func LoadIchubCache

func LoadIchubCache() baseiface.ISingleton

func LoadMetaCache

func LoadMetaCache() baseiface.ISingleton

Types

type FuncFileCache

type FuncFileCache struct {
	Pkey       string
	ExpireTime time.Duration
	// contains filtered or unexported fields
}

func NewFileCache

func NewFileCache() *FuncFileCache

func NewFunFileCache

func NewFunFileCache(pkey string) *FuncFileCache

func (*FuncFileCache) Get

func (this *FuncFileCache) Get(k string) (interface{}, bool)

func (*FuncFileCache) Set

func (this *FuncFileCache) Set(k string, x interface{})

type IchubCache

type IchubCache struct {
	basedto.BaseEntitySingle

	Pkey       string
	ExpireTime time.Duration
	// contains filtered or unexported fields
}

func FindBeanIchubCache

func FindBeanIchubCache() *IchubCache

func NewCache

func NewCache() *IchubCache

func NewIchubCache

func NewIchubCache(Pkey string) *IchubCache

func (*IchubCache) Delete

func (this *IchubCache) Delete(Key string)

func (*IchubCache) Get

func (this *IchubCache) Get(k string) (interface{}, bool)

func (*IchubCache) Set

func (this *IchubCache) Set(k string, x interface{}, d time.Duration)

type MetaCache

type MetaCache struct {
	basedto.BaseEntitySingle
	// contains filtered or unexported fields
}

func FindBeanMetaCache

func FindBeanMetaCache() *MetaCache

func NewMetaCache

func NewMetaCache() *MetaCache

func (*MetaCache) CacheGet

func (this *MetaCache) CacheGet(Key baseiface.IcacheKey) (any, bool)

func (*MetaCache) CacheGetType

func (this *MetaCache) CacheGetType(Key baseiface.IcacheKey, stype string) (any, bool)

func (*MetaCache) CacheSet

func (this *MetaCache) CacheSet(Key baseiface.IcacheKey)

func (*MetaCache) CacheSetType

func (this *MetaCache) CacheSetType(Key baseiface.IcacheKey, stype string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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