Documentation ¶
Index ¶
- Constants
- Variables
- type AuthRedisCache
- func (a *AuthRedisCache) DeleteToken(ctx context.Context, token string) error
- func (a *AuthRedisCache) GenerateAndSaveToken(ctx context.Context, email string, id int) (string, error)
- func (a *AuthRedisCache) GetTokenExpiry() time.Duration
- func (a *AuthRedisCache) GetUserByToken(ctx context.Context, token string) (string, int, error)
- type NotificationRedisCache
- func (n *NotificationRedisCache) DeleteProjectData(ctx context.Context, pid string) error
- func (n *NotificationRedisCache) GetClicksByProjectID(ctx context.Context, pid string) (map[string]string, error)
- func (n *NotificationRedisCache) GetDataByProjectID(ctx context.Context, pid string) (*string, error)
- func (n *NotificationRedisCache) GetDataExistsByProjectID(ctx context.Context, pid string) (bool, error)
- func (n *NotificationRedisCache) GetTimeByProjectID(ctx context.Context, pid string) (*time.Time, error)
- func (n *NotificationRedisCache) GetViewsByProjectID(ctx context.Context, pid string) (string, error)
- func (n *NotificationRedisCache) IncrClicks(ctx context.Context, pid string, id string) error
- func (n *NotificationRedisCache) IncrClicksIds(ctx context.Context, pid string, ids []string) error
- func (n *NotificationRedisCache) LoadScripts(ctx context.Context) error
- func (n *NotificationRedisCache) SetProjectDataExpire(ctx context.Context, pid string, expiration time.Duration) error
- func (n *NotificationRedisCache) UpdateProjectData(ctx context.Context, pid string, ids string, data string, t time.Time, ...) error
- type RemoteConfigRedisCache
- func (c *RemoteConfigRedisCache) GetDataByProjectID(ctx context.Context, pid string) (*string, error)
- func (c *RemoteConfigRedisCache) GetDataExistsByProjectID(ctx context.Context, pid string) (bool, error)
- func (c *RemoteConfigRedisCache) GetVersionByProjectID(ctx context.Context, pid string) (*int, error)
- func (c *RemoteConfigRedisCache) LoadScripts(ctx context.Context) error
- func (c *RemoteConfigRedisCache) Update(ctx context.Context, rc *domain.RemoteConfig) error
Constants ¶
View Source
const ( REDIS_ADDR = "redis:6379" REDIS_MIN_RETRY_BACKOFF = 3 * time.Second REDIS_MAX_RETRY_BACKOFF = 5 * time.Second REDIS_DATABASE_AUTH = 0 REDIS_DATABASE_RC = 1 REDIS_DATABASE_NOTIFICATOINS = 2 )
Variables ¶
View Source
var (
ErrRedisBadValue = errors.New("Bad value")
)
Functions ¶
This section is empty.
Types ¶
type AuthRedisCache ¶
type AuthRedisCache struct {
// contains filtered or unexported fields
}
func NewAuthRedisCache ¶
func NewAuthRedisCache(tokenExpiry time.Duration) *AuthRedisCache
func (*AuthRedisCache) DeleteToken ¶
func (a *AuthRedisCache) DeleteToken(ctx context.Context, token string) error
func (*AuthRedisCache) GenerateAndSaveToken ¶
func (*AuthRedisCache) GetTokenExpiry ¶
func (a *AuthRedisCache) GetTokenExpiry() time.Duration
func (*AuthRedisCache) GetUserByToken ¶
type NotificationRedisCache ¶
type NotificationRedisCache struct {
// contains filtered or unexported fields
}
func NewNotificationRedisCache ¶
func NewNotificationRedisCache() *NotificationRedisCache
func (*NotificationRedisCache) DeleteProjectData ¶
func (n *NotificationRedisCache) DeleteProjectData(ctx context.Context, pid string) error
func (*NotificationRedisCache) GetClicksByProjectID ¶
func (*NotificationRedisCache) GetDataByProjectID ¶
func (*NotificationRedisCache) GetDataExistsByProjectID ¶
func (*NotificationRedisCache) GetTimeByProjectID ¶
func (*NotificationRedisCache) GetViewsByProjectID ¶
func (*NotificationRedisCache) IncrClicks ¶
func (*NotificationRedisCache) IncrClicksIds ¶
func (*NotificationRedisCache) LoadScripts ¶
func (n *NotificationRedisCache) LoadScripts(ctx context.Context) error
func (*NotificationRedisCache) SetProjectDataExpire ¶
type RemoteConfigRedisCache ¶
type RemoteConfigRedisCache struct {
// contains filtered or unexported fields
}
func NewRemoteConfigRedisCache ¶
func NewRemoteConfigRedisCache(dataExpiry time.Duration) *RemoteConfigRedisCache
func (*RemoteConfigRedisCache) GetDataByProjectID ¶
func (*RemoteConfigRedisCache) GetDataExistsByProjectID ¶
func (*RemoteConfigRedisCache) GetVersionByProjectID ¶
func (*RemoteConfigRedisCache) LoadScripts ¶
func (c *RemoteConfigRedisCache) LoadScripts(ctx context.Context) error
func (*RemoteConfigRedisCache) Update ¶
func (c *RemoteConfigRedisCache) Update(ctx context.Context, rc *domain.RemoteConfig) error
Click to show internal directories.
Click to hide internal directories.