Documentation
¶
Index ¶
- type ClientInterface
- type MemoryCache
- func (c *MemoryCache) GetGroup(ctx context.Context, s string) (models.Group, bool, error)
- func (c *MemoryCache) GetUser(ctx context.Context, s string) (models.User, bool, error)
- func (c *MemoryCache) SetGroup(ctx context.Context, s string, g models.Group) error
- func (c *MemoryCache) SetUser(ctx context.Context, s string, u models.User) error
- type RedisCache
- func (c *RedisCache) GetGroup(ctx context.Context, s string) (models.Group, bool, error)
- func (c *RedisCache) GetUser(ctx context.Context, s string) (models.User, bool, error)
- func (c *RedisCache) SetGroup(ctx context.Context, s string, g models.Group) error
- func (c *RedisCache) SetUser(ctx context.Context, s string, u models.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientInterface ¶
type ClientInterface interface { GetUser(ctx context.Context, s string) (models.User, bool, error) SetUser(ctx context.Context, s string, u models.User) error GetGroup(ctx context.Context, s string) (models.Group, bool, error) SetGroup(ctx context.Context, s string, g models.Group) error }
ClientInterface ...
func NewCache ¶
func NewCache(ctx context.Context, cacheEngine models.CacheEngine, config config.Config) (ClientInterface, error)
NewCache ...
type MemoryCache ¶
MemoryCache ...
func NewMemoryCache ¶
func NewMemoryCache(defaultExpiration, cleanupInterval time.Duration) (*MemoryCache, error)
NewMemoryCache ...
type RedisCache ¶
RedisCache ...
func NewRedisCache ¶
func NewRedisCache(ctx context.Context, redisURL string, expiration time.Duration) (*RedisCache, error)
NewRedisCache ...
Click to show internal directories.
Click to hide internal directories.