Documentation ¶
Index ¶
- func PHashTaskIn(filepath string) interface{}
- func PHashTaskOut(out interface{}) uint64
- type AcquireImage
- type AcquiredImage
- type AsyncOutcome
- type Coordinator
- type DataContext
- type DataFlow
- type FileDownloadInput
- type FileDownloadOutput
- type FileDownloadTask
- type FileUploadOutput
- type FileUploadTask
- type Flow
- type ImageProcessor
- type ImageProcessorOutput
- type ImageResizeOutput
- type NoOpUploader
- type NoOpWriteCloser
- type PHashTask
- type RecentlyExisted
- type ResizeImageTask
- type S3Writer
- type StepAction
- type StepState
- type TaskAction
- type TaskRun
- type TaskRunInput
- type TaskRunOutput
- type TaskRunResult
- type Uploader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PHashTaskIn ¶
func PHashTaskIn(filepath string) interface{}
func PHashTaskOut ¶
func PHashTaskOut(out interface{}) uint64
Types ¶
type AcquireImage ¶
type AcquireImage struct { DownloadTimeout time.Duration MaxHeight int MaxWidth int Uploader Uploader Log logging.Logger }
func (*AcquireImage) Acquire ¶
func (a *AcquireImage) Acquire(url, filename string) (*AcquiredImage, error)
type AcquiredImage ¶
type Coordinator ¶
type Coordinator struct { Success chan *Flow Fail chan *Flow // contains filtered or unexported fields }
Coordinator - concurrent actions
func NewCoordinator ¶
func NewCoordinator(name string, concurrency int, retries int, maxItems int) *Coordinator
NewCoordintor
func (*Coordinator) Act ¶
func (d *Coordinator) Act(flows []*Flow)
func (*Coordinator) Finished ¶
func (d *Coordinator) Finished() <-chan struct{}
func (*Coordinator) From ¶
func (d *Coordinator) From(c *Coordinator)
func (*Coordinator) Run ¶
func (d *Coordinator) Run()
type DataContext ¶
type DataContext struct {
// contains filtered or unexported fields
}
func NewDataContext ¶
func NewDataContext() *DataContext
func (*DataContext) Get ¶
func (c *DataContext) Get(key string) interface{}
func (*DataContext) Set ¶
func (c *DataContext) Set(key string, value interface{})
type FileDownloadInput ¶
type FileDownloadOutput ¶
type FileDownloadTask ¶
func (*FileDownloadTask) Name ¶
func (d *FileDownloadTask) Name() string
func (*FileDownloadTask) Run ¶
func (d *FileDownloadTask) Run(input interface{}) (interface{}, error)
type FileUploadOutput ¶
type FileUploadTask ¶
type FileUploadTask struct {
Uploader Uploader
}
func (*FileUploadTask) Name ¶
func (u *FileUploadTask) Name() string
func (*FileUploadTask) Run ¶
func (u *FileUploadTask) Run(input interface{}) (interface{}, error)
type Flow ¶
func CreateFlows ¶
func GatherFailures ¶
func GatherFailures(cs ...*Coordinator) []*Flow
func (*Flow) NewStep ¶
func (f *Flow) NewStep(name string, action StepAction, state interface{})
func (*Flow) StepsWithErrors ¶
type ImageProcessor ¶
type ImageProcessor struct { // Uploader - required Uploader Uploader // LocalPath - defaults to os.TempDir()/downloads LocalPath string Log logging.Logger MaxHeight int MaxWidth int // contains filtered or unexported fields }
func (*ImageProcessor) Completed ¶
func (p *ImageProcessor) Completed() <-chan *ImageProcessorOutput
func (*ImageProcessor) Injest ¶
func (p *ImageProcessor) Injest(url, filename string, ctx *DataContext)
func (*ImageProcessor) Shutdown ¶
func (p *ImageProcessor) Shutdown()
func (*ImageProcessor) Startup ¶
func (p *ImageProcessor) Startup()
type ImageProcessorOutput ¶
type ImageResizeOutput ¶
type NoOpUploader ¶
type NoOpUploader struct { }
func (*NoOpUploader) DestinationUrl ¶
func (w *NoOpUploader) DestinationUrl(filename string) string
func (*NoOpUploader) Writer ¶
func (w *NoOpUploader) Writer(filename string) (io.WriteCloser, error)
type NoOpWriteCloser ¶
type NoOpWriteCloser struct { }
func (*NoOpWriteCloser) Close ¶
func (n *NoOpWriteCloser) Close() error
type RecentlyExisted ¶
type RecentlyExisted struct {
// contains filtered or unexported fields
}
func NewRecentlyExisted ¶
func NewRecentlyExisted(size int) *RecentlyExisted
func (*RecentlyExisted) CheckAndAdd ¶
func (r *RecentlyExisted) CheckAndAdd(t string) bool
type ResizeImageTask ¶
func (*ResizeImageTask) Name ¶
func (r *ResizeImageTask) Name() string
func (*ResizeImageTask) Run ¶
func (r *ResizeImageTask) Run(input interface{}) (interface{}, error)
type S3Writer ¶
func (*S3Writer) DestinationUrl ¶
type StepAction ¶
type StepState ¶
type StepState struct { Name string Attempts int Action StepAction State interface{} }
type TaskAction ¶
type TaskRun ¶
type TaskRun struct { Action TaskAction DiscardOutput bool Track stats.BasicMeter Log logging.Logger Concurrency int MaxQueuedIn int MaxQueuedOut int // contains filtered or unexported fields }
func (*TaskRun) Add ¶
func (t *TaskRun) Add(todo interface{}, context *DataContext)
Add - will block when the number of items queued reaches MaxQueuedInput
func (*TaskRun) Completed ¶
func (t *TaskRun) Completed() <-chan *TaskRunOutput
type TaskRunInput ¶
type TaskRunInput struct { Input interface{} Context *DataContext }
type TaskRunOutput ¶
type TaskRunOutput struct { Context *DataContext // contains filtered or unexported fields }
func (*TaskRunOutput) Error ¶
func (o *TaskRunOutput) Error() error
func (*TaskRunOutput) Input ¶
func (o *TaskRunOutput) Input() interface{}
func (*TaskRunOutput) Output ¶
func (o *TaskRunOutput) Output() interface{}
func (*TaskRunOutput) Previous ¶
func (o *TaskRunOutput) Previous(name string) *TaskRunResult
type TaskRunResult ¶
type TaskRunResult struct { Error error Input interface{} Output interface{} }
Click to show internal directories.
Click to hide internal directories.