Documentation
¶
Index ¶
- type Cache
- func (c *Cache[T]) Delete(ctx context.Context, field string) error
- func (c *Cache[T]) Get(ctx context.Context, field string) (*T, error)
- func (c *Cache[T]) GetArray(ctx context.Context, field string, dest any) error
- func (c *Cache[T]) Key(field string) string
- func (c *Cache[T]) Set(ctx context.Context, field string, data *T, expire ...time.Duration) error
- func (c *Cache[T]) SetArray(ctx context.Context, field string, data any, expire ...time.Duration) error
- type ICache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache[T any] struct { // contains filtered or unexported fields }
Cache implements the ICache interface
type ICache ¶
type ICache[T any] interface { Get(context.Context, string) (*T, error) Set(context.Context, string, *T, ...time.Duration) error Delete(context.Context, string) error GetArray(context.Context, string, any) error SetArray(context.Context, string, any, ...time.Duration) error }
ICache defines a general caching interface
Click to show internal directories.
Click to hide internal directories.