worker

package
v0.0.0-...-e2fe045 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const TaskAddSearchAnalytic = "task:add_search_analytic"
View Source
const TaskSendNewPwEmail = "task:send_new_pw_email"
View Source
const TaskSendVerifyEmail = "task:send_verify_email"

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	Context context.Context
}

func NewLogger

func NewLogger(ctx context.Context) *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) Warn

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

type PayloadAddSearchAnalytic

type PayloadAddSearchAnalytic struct {
	Professional bool           `json:"profesional"`
	Ags          string         `json:"ags"`
	Plz          sql.NullString `json:"plz"`
	Problem      string         `json:"problem"`
	Birthyear    sql.NullInt64  `json:"birthyear"`
	Gender       sql.NullString `json:"gender"`
	Law          sql.NullString `json:"law"`
	SocialForm   sql.NullString `json:"socialform"`
	ResultCount  int            `json:"resultcount"`
}

type PayloadSendNewPwEmail

type PayloadSendNewPwEmail struct {
	Uid                 int64  `json:"uid"`
	Email               string `json:"email"`
	PasswordResetSecret string `json:"passwordresetsecret"`
}

type PayloadSendVerifyEmail

type PayloadSendVerifyEmail struct {
	Uid               int64  `json:"uid"`
	Email             string `json:"email"`
	EmailVerifySecret string `json:"emailverifysecret"`
}

type RedisTaskDistributor

type RedisTaskDistributor struct {
	Client *asynq.Client
}

func (*RedisTaskDistributor) DistributeTaskAddSearchAnalytic

func (distributor *RedisTaskDistributor) DistributeTaskAddSearchAnalytic(
	ctx context.Context,
	payload *PayloadAddSearchAnalytic,
	opts ...asynq.Option,
) error

func (*RedisTaskDistributor) DistributeTaskSendNewPwEmail

func (distributor *RedisTaskDistributor) DistributeTaskSendNewPwEmail(
	ctx context.Context,
	payload *PayloadSendNewPwEmail,
	opts ...asynq.Option,
) error

func (*RedisTaskDistributor) DistributeTaskSendVerifyEmail

func (distributor *RedisTaskDistributor) DistributeTaskSendVerifyEmail(
	ctx context.Context,
	payload *PayloadSendVerifyEmail,
	opts ...asynq.Option,
) error

type RedisTaskProcessor

type RedisTaskProcessor struct {
	Server *asynq.Server
	Db     *database.DB
	Config *config.Config
}

func (*RedisTaskProcessor) ProcessTaskAddSearchAnalytic

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

func (*RedisTaskProcessor) ProcessTaskSendNewPwEmail

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

func (*RedisTaskProcessor) ProcessTaskSendVerifyEmail

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

func (*RedisTaskProcessor) Shutdown

func (processor *RedisTaskProcessor) Shutdown()

func (*RedisTaskProcessor) Start

func (processor *RedisTaskProcessor) Start() error

type TaskDistributor

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

func NewRedisTaskDistributor

func NewRedisTaskDistributor(redisOpt asynq.RedisClientOpt) TaskDistributor

type TaskProcessor

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

func NewRedisTaskProcessor

func NewRedisTaskProcessor(ctx context.Context, redisOpt asynq.RedisClientOpt, db *database.DB, cfg *config.Config) TaskProcessor

Jump to

Keyboard shortcuts

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