queue

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TopicExtraction = "extraction-tasks"
	TopicSync       = "sync-tasks"
	TopicHealth     = "health-check-tasks"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtractionTask

type ExtractionTask struct {
	Platform string `json:"platform"`
}

type Queue

type Queue struct {
	Producer *kafka.Writer
	DB       *pgxpool.Pool
	Syncer   *sync.Syncer
	// contains filtered or unexported fields
}

func New

func New(cfg *config.Config, db *pgxpool.Pool, syncer *sync.Syncer) (*Queue, error)

func (*Queue) Close

func (q *Queue) Close() error

func (*Queue) Drain

func (q *Queue) Drain()

func (*Queue) Health

func (q *Queue) Health(ctx context.Context) error

func (*Queue) InvalidateContestsCache added in v1.4.0

func (q *Queue) InvalidateContestsCache(ctx context.Context, platform string) error

func (*Queue) PublishExtractionTask

func (q *Queue) PublishExtractionTask(ctx context.Context, platform string) error

func (*Queue) PublishSyncTask

func (q *Queue) PublishSyncTask(ctx context.Context, userID int) error

func (*Queue) StartConsumers

func (q *Queue) StartConsumers(ctx context.Context, cfg *config.Config)

type SyncTask

type SyncTask struct {
	UserID int `json:"user_id"`
}

type TaskType

type TaskType string
const (
	TaskExtraction TaskType = "extraction"
	TaskSync       TaskType = "sync"
)

Jump to

Keyboard shortcuts

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