redis

package
v0.0.0-...-3ec4966 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2022 License: MIT Imports: 10 Imported by: 2

Documentation

Index

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 (a *AuthRedisCache) GenerateAndSaveToken(ctx context.Context, email string, id int) (string, error)

func (*AuthRedisCache) GetTokenExpiry

func (a *AuthRedisCache) GetTokenExpiry() time.Duration

func (*AuthRedisCache) GetUserByToken

func (a *AuthRedisCache) GetUserByToken(ctx context.Context, token string) (string, int, error)

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 (n *NotificationRedisCache) GetClicksByProjectID(ctx context.Context, pid string) (map[string]string, error)

func (*NotificationRedisCache) GetDataByProjectID

func (n *NotificationRedisCache) GetDataByProjectID(ctx context.Context, pid string) (*string, error)

func (*NotificationRedisCache) GetDataExistsByProjectID

func (n *NotificationRedisCache) GetDataExistsByProjectID(ctx context.Context, pid string) (bool, error)

func (*NotificationRedisCache) GetTimeByProjectID

func (n *NotificationRedisCache) GetTimeByProjectID(ctx context.Context, pid string) (*time.Time, error)

func (*NotificationRedisCache) GetViewsByProjectID

func (n *NotificationRedisCache) GetViewsByProjectID(ctx context.Context, pid string) (string, error)

func (*NotificationRedisCache) IncrClicks

func (n *NotificationRedisCache) IncrClicks(ctx context.Context, pid string, id string) error

func (*NotificationRedisCache) IncrClicksIds

func (n *NotificationRedisCache) IncrClicksIds(ctx context.Context, pid string, ids []string) error

func (*NotificationRedisCache) LoadScripts

func (n *NotificationRedisCache) LoadScripts(ctx context.Context) error

func (*NotificationRedisCache) SetProjectDataExpire

func (n *NotificationRedisCache) SetProjectDataExpire(ctx context.Context, pid string, expiration time.Duration) error

func (*NotificationRedisCache) UpdateProjectData

func (n *NotificationRedisCache) UpdateProjectData(ctx context.Context, pid string, ids string, data string, t time.Time, expire time.Duration) error

type RemoteConfigRedisCache

type RemoteConfigRedisCache struct {
	// contains filtered or unexported fields
}

func NewRemoteConfigRedisCache

func NewRemoteConfigRedisCache(dataExpiry time.Duration) *RemoteConfigRedisCache

func (*RemoteConfigRedisCache) GetDataByProjectID

func (c *RemoteConfigRedisCache) GetDataByProjectID(ctx context.Context, pid string) (*string, error)

func (*RemoteConfigRedisCache) GetDataExistsByProjectID

func (c *RemoteConfigRedisCache) GetDataExistsByProjectID(ctx context.Context, pid string) (bool, error)

func (*RemoteConfigRedisCache) GetVersionByProjectID

func (c *RemoteConfigRedisCache) GetVersionByProjectID(ctx context.Context, pid string) (*int, error)

func (*RemoteConfigRedisCache) LoadScripts

func (c *RemoteConfigRedisCache) LoadScripts(ctx context.Context) error

func (*RemoteConfigRedisCache) Update

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL