cache

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT, MIT Imports: 4 Imported by: 0

Documentation

Overview

Package cache provides caching support for high-frequency administrative queries.

Index

Constants

View Source
const DefaultTTL = 5 * time.Minute

DefaultTTL defines the default duration for caching administrative flags.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	GetDisabled(ctx context.Context, userID string) (bool, bool, error)
	SetDisabled(ctx context.Context, userID string, disabled bool, ttl time.Duration) error
	DeleteDisabled(ctx context.Context, userID string) error

	GetIsAdmin(ctx context.Context, userID string) (bool, bool, error)
	SetIsAdmin(ctx context.Context, userID string, isAdmin bool, ttl time.Duration) error
	DeleteIsAdmin(ctx context.Context, userID string) error
}

Cache defines the domain caching contract for administrative checks.

func New

func New(c corecache.Cache) Cache

New creates a new domain Cache wrapping a Core Cache adapter.

Jump to

Keyboard shortcuts

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