Documentation
¶
Overview ¶
Costume logger for asyqn redis implementing: Debug(args ...interface{}) Info(args ...interface{}) Warn(args ...interface{}) Error(args ...interface{}) Fatal(args ...interface{})
Index ¶
- Constants
- type Logger
- func (logger *Logger) Debug(args ...interface{})
- func (logger *Logger) Error(args ...interface{})
- func (logger *Logger) Fatal(args ...interface{})
- func (logger *Logger) Info(args ...interface{})
- func (logger *Logger) Print(level zerolog.Level, args ...interface{})
- func (logger *Logger) Printf(ctx context.Context, format string, v ...interface{})
- func (logger *Logger) Warn(args ...interface{})
- type PayloadSendVerifyEmail
- type RedisTaskDistributor
- type RedisTaskProcessor
- type TaskDistributor
- type TaskProcessor
Constants ¶
const ( QueueCritical = "critical" QueueDefault = "default" )
queque name
const TaskSendVerifyEmail = "task:send_verify_email"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PayloadSendVerifyEmail ¶
type PayloadSendVerifyEmail struct {
Username string `json:"username"`
}
PayloadSendVerifyEmail struct of data needed for worker to do tas send verify email
type RedisTaskDistributor ¶
type RedisTaskDistributor struct {
// contains filtered or unexported fields
}
func (*RedisTaskDistributor) DistributeTaskSendVerifyEmail ¶
func (redisDistributor *RedisTaskDistributor) DistributeTaskSendVerifyEmail( ctx context.Context, payload *PayloadSendVerifyEmail, opts ...asynq.Option, ) error
DistributeTaskSendVerifyEmail to Distribute new task to redis when a user was created
type RedisTaskProcessor ¶
type RedisTaskProcessor struct {
// contains filtered or unexported fields
}
func (*RedisTaskProcessor) ProcessTaskSendVerifyEmail ¶
func (processor *RedisTaskProcessor) ProcessTaskSendVerifyEmail(ctx context.Context, task *asynq.Task) error
ProcessTaskSendVerifyEmail - function to process "task:send_verify_email" do sending verify email when new user are created
func (*RedisTaskProcessor) Start ¶
func (processor *RedisTaskProcessor) Start() error
Start - to set some woker and start redis server
type TaskDistributor ¶
type TaskDistributor interface {
//DistributeTaskSendVerifyEmail to Distribute task to redis when new user was created
DistributeTaskSendVerifyEmail(
ctx context.Context,
payload *PayloadSendVerifyEmail,
opts ...asynq.Option,
) error
}
func NewRedisTaskDistributor ¶
func NewRedisTaskDistributor(redisOpt asynq.RedisClientOpt) TaskDistributor
NewRedisTaskDistributor create redis task distributor with given opt
type TaskProcessor ¶
type TaskProcessor interface {
Start() error
ProcessTaskSendVerifyEmail(ctx context.Context, task *asynq.Task) error
}
TaskProcessor write your new task processor for each task func
func NewRedisTaskProcessor ¶
func NewRedisTaskProcessor(redisOpt asynq.RedisClientOpt, store db.Store, mailer mail.EmailSender) TaskProcessor
NewRedisTaskProcessor returning redis server processor