caching

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DiskCacheType = "disk-cache"
)
View Source
const (
	SQLLiteStoreType = "sqllite-cache"
)

Variables

This section is empty.

Functions

func NewCache

func NewCache[T any]() *cache.Cache[T]

func NewSQLLiteStore

func NewSQLLiteStore[T any]() store.StoreInterface

Types

type DiskStore

type DiskStore[T any] struct {
	// contains filtered or unexported fields
}

func (DiskStore[T]) Clear

func (store DiskStore[T]) Clear(ctx context.Context) error

func (DiskStore[T]) Delete

func (store DiskStore[T]) Delete(ctx context.Context, key any) error

func (DiskStore[T]) Get

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

func (DiskStore[T]) GetType

func (store DiskStore[T]) GetType() string

func (DiskStore[T]) GetWithTTL

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

func (DiskStore[T]) Invalidate

func (store DiskStore[T]) Invalidate(ctx context.Context, options ...lib_store.InvalidateOption) error

func (DiskStore[T]) Set

func (store DiskStore[T]) Set(ctx context.Context, key any, value any, options ...lib_store.Option) error

type SQLLiteStore

type SQLLiteStore[T any] struct {
	// contains filtered or unexported fields
}

func (SQLLiteStore[T]) Clear

func (store SQLLiteStore[T]) Clear(ctx context.Context) error

func (SQLLiteStore[T]) Delete

func (store SQLLiteStore[T]) Delete(ctx context.Context, key any) error

func (SQLLiteStore[T]) Get

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

func (SQLLiteStore[T]) GetType

func (store SQLLiteStore[T]) GetType() string

func (SQLLiteStore[T]) GetWithTTL

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

func (SQLLiteStore[T]) Invalidate

func (store SQLLiteStore[T]) Invalidate(ctx context.Context, options ...lib_store.InvalidateOption) error

func (SQLLiteStore[T]) Set

func (store SQLLiteStore[T]) Set(ctx context.Context, key any, value any, options ...lib_store.Option) error

Jump to

Keyboard shortcuts

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