worker

package
v0.0.0-...-0cfb189 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueueCritical = "critical"
	QueueDefault  = "default"
	QueueLow      = "low"
)
View Source
const TaskSendVerifyEmail = "task:send_verfiy_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{})

Debug logs a message at Debug level.

func (*Logger) Error

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

Error logs a message at Error level.

func (*Logger) Fatal

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

Fatal logs a message at Fatal level and process will exit with status set to 1.

func (*Logger) Info

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

Info logs a message at Info level.

func (*Logger) Print

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

func (*Logger) Warn

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

Warn logs a message at Warning level.

type PayloadSendVerifyEmail

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

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

type RedisTaskProcessor

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

func (*RedisTaskProcessor) ProcessTaskSendVerifyEmail

func (processor *RedisTaskProcessor) ProcessTaskSendVerifyEmail(ctx context.Context, task *asynq.Task) error

func (*RedisTaskProcessor) Start

func (processor *RedisTaskProcessor) Start() error

type TaskDistributor

type TaskDistributor interface {
	DistributeTaskSendVerifyEmail(
		ctx context.Context,
		payload *PayloadSendVerifyEmail,
		opts ...asynq.Option,
	) error
}

func NewRedisTaskDistributor

func NewRedisTaskDistributor(redisOpt asynq.RedisClientOpt) TaskDistributor

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

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