Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrConversionTimeout = errors.New("conversion timed out")
)
Functions ¶
func InitWorkers ¶
Types ¶
type Conversion ¶
type Conversion struct { // Path is the URI to the resource to be converted. Path string }
Conversion represents the most basic, skeleton conversion job. Currently, it is assumed that the input is a HTML (or similar) resource, and the output is a PDF. Conversion implements the Converter interface with dummy methods. Any child conversion type should overwrite these methods.
func (Conversion) Convert ¶
func (c Conversion) Convert(done <-chan struct{}) ([]byte, error)
Convert should return a byte slice containing the converted resource, synchronously. It should terminate any long-running processes (and Goroutines) if the done channel is returned.
type UploadConversion ¶
type UploadConversion struct { Conversion AWSS3 }
type Work ¶
type Work struct {
// contains filtered or unexported fields
}
func (Work) Cancel ¶
func (w Work) Cancel()
Cancel will close the done channel. This will indicate to child Goroutines that the job has been terminated, and the results are no longer needed.
func (Work) Cancelled ¶
func (w Work) Cancelled() <-chan struct{}
Cancelled returns a channel that will indicate when a job has been completed.
func (Work) Error ¶
Error returns a channel that will be used for publishing errors from a conversion.