worker

package
v0.0.0-...-145237b Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueueCritical = "critical"
	QueueDefault  = "default"
)
View Source
const (
	TaskSendPropertyListing = "task:send_property_listing"
)

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 PayloadSendPropertyListing

type PayloadSendPropertyListing struct {
	Properties []int64 `json:"properties"`
}

type Property

type Property struct {
	ID      int64     `json:"id"`
	Address string    `json:"address"`
	Price   int32     `json:"price"`
	AddedAt time.Time `json:"added_at"`
	Image   string    `json:"image"`
}

type RedisTaskDistributor

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

func (RedisTaskDistributor) DistributeTaskSendPropertyListing

func (r RedisTaskDistributor) DistributeTaskSendPropertyListing(ctx context.Context, payload *PayloadSendPropertyListing, opts ...asynq.Option) error

type RedisTaskProcessor

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

func (*RedisTaskProcessor) ProcessTaskSendPropertyListing

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

func (*RedisTaskProcessor) Start

func (processor *RedisTaskProcessor) Start() error

type TaskDistributor

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

func NewRedisTaskDistributor

func NewRedisTaskDistributor(redisOpt asynq.RedisClientOpt) TaskDistributor

type TaskProcessor

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

func NewRedisTaskProcessor

func NewRedisTaskProcessor(redisOpt asynq.RedisClientOpt, store database.Store, mailer mail.EmailSender, config utils.Config) TaskProcessor

Jump to

Keyboard shortcuts

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