cache

package
v0.0.0-...-2a7283e Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache is a simple caching interface for Redis

func NewCache

func NewCache(client *redis.Client, prefix string) *Cache

NewCache creates a new Redis cache client

func (*Cache) DeleteApplicationByAPIKey

func (c *Cache) DeleteApplicationByAPIKey(ctx context.Context, apiKey string) error

DeleteApplicationByAPIKey removes an application from cache by API key

func (*Cache) GetApplicationByAPIKey

func (c *Cache) GetApplicationByAPIKey(ctx context.Context, apiKey string) (*model.ApplicationCache, error)

GetApplicationByAPIKey retrieves an application from cache by API key

func (*Cache) SetApplicationByAPIKey

func (c *Cache) SetApplicationByAPIKey(ctx context.Context, app *model.ApplicationCache, expiration time.Duration) error

SetApplicationByAPIKey caches an application with the given API key and expiration

Jump to

Keyboard shortcuts

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