Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrCacheMiss = errors.New("cache miss")
)
View Source
var Module = fx.Module( "cache", fx.Provide( NewClient, NewUsernamesTaken, NewRefreshToken, ), )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
Set(ctx context.Context, key string, data any, ttl time.Duration) error
Get(ctx context.Context, key string) (any, error)
Del(ctx context.Context, key ...string) error
AddToSet(ctx context.Context, key string, data ...any) error
IsDataInSet(ctx context.Context, key string, data any) (bool, error)
}
func NewRamClient ¶
type RefreshToken ¶
type RefreshToken interface {
Set(ctx context.Context, key string, id uint64, ttl time.Duration) error
Get(ctx context.Context, key string) (id uint64, err error)
Del(ctx context.Context, key string) (bool, error)
}
func NewRefreshToken ¶
func NewRefreshToken( client Client, logger *zap.Logger, ) RefreshToken
Click to show internal directories.
Click to hide internal directories.