kos/pkg/cache/cache.go

14 lines
290 B
Go
Raw Permalink Normal View History

2023-04-23 17:57:36 +08:00
package cache
import (
"context"
"time"
)
type Cache interface {
Set(ctx context.Context, key string, value any)
SetEx(ctx context.Context, key string, value any, expire time.Duration)
Get(ctx context.Context, key string) (value any, ok bool)
Del(ctx context.Context, key string)
}