Documentation ¶
Overview ¶
Package gonzo is a file-processing Framework based on Go [Pipelines](http://blog.golang.org/pipelines) concept.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
File is the virtual-file API used by Gonzo. This method `State` is provided for interoperability with os.File, so consider using the following interface for a Gonzo and os.File compatiable API
type File interface { io.ReadCloser Stat() (os.FileInfo, error) }
type FileInfo ¶
type FileInfo interface { Name() string Size() int64 Mode() os.FileMode ModTime() time.Time IsDir() bool Sys() interface{} Base() string SetName(string) SetSize(int64) SetMode(os.FileMode) SetModTime(time.Time) SetIsDir(bool) SetBase(string) }
FileInfo is a mutuable superset of os.FileInfo with the additon of "Base"
func FileInfoFrom ¶
FileInfoFrom createa a FileInfo from an os.FileInfo. Useful when working with os.File or other APIs that mimics http.FileSystem.
type Pipe ¶
type Pipe interface { Context() context.Context Files() <-chan File Pipe(stages ...Stage) Pipe Then(stages ...Stage) error Wait() error }
Pipe handles stages and talks to other pipes.
type Stage ¶
Stage is a function that takes a context, a channel of files to read and an output chanel. There is no correlation between a stages input and output, a stage may decided to pass the same files after transofrmation or generate new files based on the input or drop files.
A stage must not close the output channel based on the simple "Don't close it if you don't own it" principle. A stage must either pass on a file or call the `Close` method on it.