Documentation
¶
Index ¶
- func KeyNormalized(norm string) string
- func KeyUserID(userID string) string
- type Cache
- func (c *Cache) GetByNormalized(ctx context.Context, norm string) (*CachedRecord, bool)
- func (c *Cache) GetByUserID(ctx context.Context, userID string) (*CachedRecord, bool)
- func (c *Cache) Invalidate(ctx context.Context, norm, userID string)
- func (c *Cache) Set(ctx context.Context, rec *CachedRecord)
- type CachedRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeyNormalized ¶
KeyNormalized returns the namespaced cache key for a normalized username. Format: gomodularauth:username:norm:<normalized>
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache wraps the core Cache adapter with semantic username operations.
func New ¶
New constructs a semantic Cache wrapper around an optional core Cache. If c is nil, Cache gracefully acts as a no-op layer.
func (*Cache) GetByNormalized ¶
GetByNormalized returns the cached username record for a normalized username, if present.
func (*Cache) GetByUserID ¶
GetByUserID returns the cached username record for a user ID, if present.
func (*Cache) Invalidate ¶
Invalidate removes cached entries for the normalized username and user ID.
Click to show internal directories.
Click to hide internal directories.