processor

package
v0.0.0-...-affaa53 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	FilePath string
	File     fileheader.FileHeader
}

type Processor

type Processor struct {
	ProcessTimeout time.Duration
	MaxWorkers     int
	// contains filtered or unexported fields
}

Processor processes jobs concurrently

func New

func New(workerFn func(job Job) (interface{}, error), maxWorkers int, processTimeout time.Duration) *Processor

New returns a new instance of Processor

func (*Processor) Do

func (p *Processor) Do(ctx context.Context, jobCh chan Job, jobCount int) ([]ResultSuccess, []ResultError)

Process processes files and extracts file metadata

type ResultError

type ResultError struct {
	FilePath string
	Error    error
}

ResultError stores error data

type ResultSuccess

type ResultSuccess struct {
	FilePath string
	Output   interface{}
}

ResultError stores success data

Jump to

Keyboard shortcuts

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