worker

package
v0.0.0-...-4aceef1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueueCritical = "critical"
	QueueDefault  = "default"
)
View Source
const TaskSendVeryEmail = "task:send_verify_email"

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
}

func NewLogger

func NewLogger() *Logger

func (*Logger) Debug

func (logger *Logger) Debug(args ...interface{})

func (*Logger) Error

func (logger *Logger) Error(args ...interface{})

func (*Logger) Fatal

func (logger *Logger) Fatal(args ...interface{})

func (*Logger) Info

func (logger *Logger) Info(args ...interface{})

func (*Logger) Print

func (logger *Logger) Print(level zerolog.Level, args ...interface{})

func (*Logger) Printf

func (logger *Logger) Printf(ctx context.Context, format string, v ...interface{})

func (*Logger) Warn

func (logger *Logger) Warn(args ...interface{})

type PayloadSendVerifyEmail

type PayloadSendVerifyEmail struct {
	Username string `json:"username"`
}

PayloadSendVerifyEmail is the payload for sending a verification email.

type RedisTaskDistributor

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

func (*RedisTaskDistributor) DistributeTaskSendVerifyEmail

func (distributor *RedisTaskDistributor) DistributeTaskSendVerifyEmail(

	ctx context.Context,
	payload PayloadSendVerifyEmail,
	opts ...asynq.Option,

) error

DistributeTaskSendVerifyEmail distributes a task, and send a verification email.

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 processes a task, and send a verification email.

func (*RedisTaskProcessor) Start

func (processor *RedisTaskProcessor) Start() error

Start starts the RedisTaskProcessor

type TaskDistributor

type TaskDistributor interface {
	// DistributeTask()
	// SendEmail()
	// VerifyEmail()
	DistributeTaskSendVerifyEmail(
		ctx context.Context,
		payload PayloadSendVerifyEmail,
		opts ...asynq.Option,
	) error
}

TaskDistributor

func NewRedisTaskDistributor

func NewRedisTaskDistributor(redisOpt asynq.RedisClientOpt) TaskDistributor

NewRedisTaskDistributor creates a new RedisTaskDistributor

type TaskProcessor

type TaskProcessor interface {
	Start() error
	ProcessTaskSendVerifyEmail(ctx context.Context, task *asynq.Task) error
}

func NewRedisTaskProcessor

func NewRedisTaskProcessor(redisOpt asynq.RedisClientOpt, store db.Store, mailer mail.EmailSender) TaskProcessor

NewRedisTaskProcessor creates a new RedisTaskProcessor

Directories

Path Synopsis
Package mockwk is a generated GoMock package.
Package mockwk is a generated GoMock package.

Jump to

Keyboard shortcuts

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