cache

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheClient

type CacheClient struct {
	// Client stores the client to the underlying cache service
	Client *redis.Client
	// contains filtered or unexported fields
}

CacheClient is the client that allows you to interact with the cache

func NewCacheClient

func NewCacheClient(cfg *config.Config) (*CacheClient, error)

NewCacheClient is a temporary compatibility alias during the app-to-framework move.

func NewClient

func NewClient(cfg *config.Config) (*CacheClient, error)

NewClient creates a new cache client.

func (*CacheClient) Close

func (c *CacheClient) Close() error

Close closes the connection to the cache

func (*CacheClient) DeleteKey

func (c *CacheClient) DeleteKey(ctx context.Context, key string) error

func (*CacheClient) Flush

func (c *CacheClient) Flush() *cacheFlush

Flush creates a cache flush operation

func (*CacheClient) Get

func (c *CacheClient) Get() *cacheGet

Get creates a cache get operation

func (*CacheClient) GetBytes

func (c *CacheClient) GetBytes(ctx context.Context, key string) ([]byte, bool, error)

func (*CacheClient) InvalidatePrefix

func (c *CacheClient) InvalidatePrefix(ctx context.Context, prefix string) error

func (*CacheClient) Set

func (c *CacheClient) Set() *cacheSet

Set creates a cache set operation

func (*CacheClient) SetBytes

func (c *CacheClient) SetBytes(ctx context.Context, key string, value []byte, ttl time.Duration) error

type OtterStore

type OtterStore struct {
	// contains filtered or unexported fields
}

func NewOtterStore

func NewOtterStore(capacity int) (*OtterStore, error)

func (*OtterStore) Close

func (s *OtterStore) Close() error

func (*OtterStore) Delete

func (s *OtterStore) Delete(key string) error

func (*OtterStore) Get

func (s *OtterStore) Get(key string) ([]byte, bool)

func (*OtterStore) InvalidatePrefix

func (s *OtterStore) InvalidatePrefix(prefix string) error

func (*OtterStore) InvalidateTags

func (s *OtterStore) InvalidateTags(tags []string) error

func (*OtterStore) Set

func (s *OtterStore) Set(key string, value []byte, ttl time.Duration) error

func (*OtterStore) SetTags

func (s *OtterStore) SetTags(key string, tags []string)

Jump to

Keyboard shortcuts

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