cache

package
v0.7.12 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedData

type CachedData[T EnkaCacheAble] struct {
	// contains filtered or unexported fields
}

func NewCachedData

func NewCachedData[T EnkaCacheAble](data T) CachedData[T]

func (*CachedData[T]) GetData

func (c *CachedData[T]) GetData() T

func (*CachedData[T]) IsExpired

func (c *CachedData[T]) IsExpired() bool

type EnkaCacheAble

type EnkaCacheAble interface {
	GetTtl() int
}

type EnkaHttpCache added in v0.4.0

type EnkaHttpCache interface {
	AddGenshinUser(*genshin.RawUser)
	GetGenshinUser(string) *genshin.RawUser

	AddHSRUser(*starrail.RawUser)
	GetHsrUser(string) *starrail.RawUser
}

func Default added in v0.2.3

func Default(log zerolog.Logger) EnkaHttpCache

func ExternalCacheWrapper added in v0.4.0

func ExternalCacheWrapper(ext ExternalCache, log zerolog.Logger) EnkaHttpCache

type ExternalCache added in v0.4.0

type ExternalCache interface {
	Save(key string, data []byte) error
	Load(key string) ([]byte, error)
}

Jump to

Keyboard shortcuts

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