tasks

package
v0.0.0-...-6d375a0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CrawlTaskType = "crawl"
)

Variables

This section is empty.

Functions

func EnqueueCrawlTask

func EnqueueCrawlTask(client AsynqClient, payload *CrawlTaskPayload) (string, error)

EnqueueCrawlTask creates asynq task

func NewCrawlTask

func NewCrawlTask(payload *CrawlTaskPayload) (*asynq.Task, error)

Types

type AsynqClient

type AsynqClient interface {
	Enqueue(task *asynq.Task, opts ...asynq.Option) (*asynq.TaskInfo, error)
}

AsynqClient defines an interface with the methods you use from asynq.Client.

type CrawlTaskPayload

type CrawlTaskPayload struct {
	URL         string `json:"url"`
	SearchTerms string `json:"search_terms"`
	CrawlSiteID string `json:"crawl_site_id"`
	MaxDepth    int    `json:"max_depth"`
	Debug       bool   `json:"debug"`
}

Jump to

Keyboard shortcuts

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