job

package
v0.0.0-...-deb3f62 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel interface {
	// Send
	Send(j *Job) error
	// contains filtered or unexported methods
}

Channel

func NewChannel

func NewChannel(scanType ScanType, buffer int) Channel

NewChannel

type Channels

type Channels map[ScanType]Channel

Channels

func RegisterChannels

func RegisterChannels(buffer int, scanTypes ...ScanType) Channels

RegisterChannels

func (Channels) Get

func (cc Channels) Get(st ScanType) (Channel, error)

Get

type Controller

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

Controller

func NewController

func NewController(channel Channel, poolSize int, scanner Scanner) *Controller

NewController

func (*Controller) Start

func (c *Controller) Start(ctx context.Context)

Start

type Job

type Job struct {
	ScanType   ScanType
	CorpusName string
	Payload    interface{}
}

Job

func New

func New(scanType ScanType, corpusName string, payload interface{}) *Job

New returns new Job.

type ScanFunc

type ScanFunc func(payload interface{}) interface{}

ScanFunc

func Scan

func Scan(scanner Scanner) ScanFunc

Scan

type ScanType

type ScanType string

ScanType is type of Job that has to be executed.

const (
	ScanTypeDir  ScanType = "DIR"
	ScanTypeFile ScanType = "FILE"
	ScanTypeWeb  ScanType = "WEB"
)

Job types

type Scanner

type Scanner interface {
	// ScanJob
	ScanJob(j *Job) error
}

Scanner

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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