crawler

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EndCallback

func EndCallback(db *gorm.DB, mod string)

func NewEngine

func NewEngine(workerCount uint) *conctrl.Engine[string, Prop, Prop]

Types

type BaseTaskMeta

type BaseTaskMeta = conctrl.BaseTaskMeta[string]

type Cursor

type Cursor struct {
	Type   string `json:"type" gorm:"primaryKey"`
	Cursor string
	Prev   string
	Next   string
}

func GetCursor

func GetCursor(db *gorm.DB, mod string) (*Cursor, error)

type Engine

type Engine = conctrl.Engine[string, Prop, Prop]

type HandleFunc

type HandleFunc func(ctx context.Context, url string) ([]*Request, error)

type Prop

type Prop struct {
}

type Request

type Request = conctrl.Task[string, Prop]

func EndCallbackReq

func EndCallbackReq(db *gorm.DB, mod string) *Request

func NewRequest

func NewRequest(key string, kind conctrl.Kind, taskFunc TaskFunc) *Request

func NewUrlKindRequest

func NewUrlKindRequest(url string, kind conctrl.Kind, handleFunc HandleFunc) *Request

func NewUrlRequest

func NewUrlRequest(url string, handleFunc HandleFunc) *Request

type TaskFunc

type TaskFunc = conctrl.TaskFunc[string, Prop]

type TaskMeta

type TaskMeta = conctrl.TaskMeta[string]

func NewTaskMeta

func NewTaskMeta(key string) TaskMeta

Jump to

Keyboard shortcuts

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