queue

package
v0.0.0-...-2965246 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParseGeoRequestJob = "ParseGeoRequestJob"
	DetectSpamJob      = "DetectSpamJob"
	ExpirationJob      = "ExpirationJob"
	RemovePendingJob   = "RemovePendingJob"
)

Variables

This section is empty.

Functions

func DispatchDetectSpamJob

func DispatchDetectSpamJob(qc *que.Client, url string) error

DispatchDetectSpamJob dispatches a job to que-go to detect unsafe links. If url is empty, it will scan all urls

func DispatchExpirationJob

func DispatchExpirationJob(qc *que.Client) error

func DispatchParseGeoRequestJob

func DispatchParseGeoRequestJob(qc *que.Client, request ParseGeoRequest) error

func DispatchRemovePendingJob

func DispatchRemovePendingJob(qc *que.Client) error

func GetPgxPool

func GetPgxPool(dbURL string) (*pgx.ConnPool, error)

GetPgxPool based on the provided database URL

func Setup

func Setup(dbURL string) (*pgx.ConnPool, *que.Client, error)

Setup a *pgx.ConnPool and *que.Client This is here so that setup routines can easily be shared between web and workers

Types

type DetectSpamRequest

type DetectSpamRequest struct {
	URL string `json:"url"`
}

type ParseGeoRequest

type ParseGeoRequest struct {
	IP   string `json:"ip"`
	Slug string `json:"slug"`
}

Jump to

Keyboard shortcuts

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