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.
Click to show internal directories.
Click to hide internal directories.