Documentation ¶
Index ¶
- type BackupMessageReadWriter
- type BackupMessageRemover
- type BackupMessageSender
- type DBClient
- type RedisBackup
- func (rb *RedisBackup) GetIdleKeys(ctx context.Context, over time.Duration) ([]string, error)
- func (rb *RedisBackup) GetVal(key string) (*apiv1.NotificationRequest, error)
- func (rb *RedisBackup) Remove(req *apiv1.NotificationRequest) error
- func (rb *RedisBackup) Send(req *apiv1.NotificationRequest) error
- type RedisTemplate
- type TemplateReadWriter
- type TemplateReader
- type TemplateWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackupMessageReadWriter ¶
type BackupMessageReadWriter interface { BackupMessageSender BackupMessageRemover }
BackupMessageReadWriter reads and writes the backup message.
type BackupMessageRemover ¶
type BackupMessageRemover interface { // Remove removes the message Remove(req *apiv1.NotificationRequest) error }
BackupMessageRemover removes the message
type BackupMessageSender ¶
type BackupMessageSender interface { // Send sends the message Send(req *apiv1.NotificationRequest) error // GetIdleKeyVals gets the idle keys GetIdleKeys(ctx context.Context, over time.Duration) ([]string, error) // GetVal gets the value GetVal(key string) (*apiv1.NotificationRequest, error) }
BackupMessageSender sends the message to a destination
type DBClient ¶
type DBClient struct {
// contains filtered or unexported fields
}
DBClient is the database client for all databases
func NewDBClient ¶
NewDBClient creates a new client and connects to the database. This connection is reusable but it has to be closed. TODO: use config.DB instead, we can also add a connection pool (SetMaxIdleConns, SetMaxOpenConns, SetConnMaxLifetime)
func (*DBClient) GetNotificationsDB ¶
func (*DBClient) GetUsersDB ¶
type RedisBackup ¶
type RedisBackup struct {
// contains filtered or unexported fields
}
RedisBackup is used to read and write backup messages
func NewRedisBackup ¶
func NewRedisBackup(endpoint, password string, db int) *RedisBackup
NewRedisBackup creates a new RedisBackup
func (*RedisBackup) GetIdleKeys ¶
GetIdleKeys gets the idle keys
func (*RedisBackup) GetVal ¶
func (rb *RedisBackup) GetVal(key string) (*apiv1.NotificationRequest, error)
GetVal gets the value given a key
func (*RedisBackup) Remove ¶
func (rb *RedisBackup) Remove(req *apiv1.NotificationRequest) error
Remove removes the message
func (*RedisBackup) Send ¶
func (rb *RedisBackup) Send(req *apiv1.NotificationRequest) error
Send sends the message
type RedisTemplate ¶
type RedisTemplate struct {
// contains filtered or unexported fields
}
RedisTemplate is used to read and write templates
func NewRedisTemplate ¶
func NewRedisTemplate(endpoint, password string, db int) *RedisTemplate
NewRedisTemplate creates a new RedisTemplate
type TemplateReadWriter ¶
type TemplateReadWriter interface { TemplateReader TemplateWriter }
TemplateReadWriter reads and writes the templates
type TemplateReader ¶
type TemplateReader interface { // Read reads the template Read(templateID *string) (*template.Template, error) }
TemplateReader reads the templates from a source
type TemplateWriter ¶
TemplateWriter writes the templates to a destination