cache

package
v1.0.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(ctx context.Context, key string) error

func Get

func Get[T any](ctx context.Context, key string) (T, error)

func GetWithTTL

func GetWithTTL[T any](ctx context.Context, key string) (T, time.Duration, error)

GetWithTTL returns the object stored in cache and its corresponding TTL

func Set

func Set(ctx context.Context, key string, value any) error

只能缓存基本类型

func SetWithTTL

func SetWithTTL(ctx context.Context, key string, value any, ttl time.Duration) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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