Documentation
¶
Index ¶
- func ProvideSource(u *url.URL, providers ...Provider) (io.ReadCloser, error)
- type Call
- type Command
- type DestroyableFile
- type ErrorFunc
- type FileProvider
- type HTTPProvider
- type MultiError
- type NoOpWriteDestroyCloser
- type PipeProvider
- type Provider
- type S3Provider
- type S3PutObject
- type SourcePipe
- type SourceProvider
- type Sources
- type TargetPipe
- type TargetProvider
- type Targets
- type Task
- type TemplateGenerator
- type Url
- type UrlMapping
- type WriteDestroyCloser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProvideSource ¶
ProvideSource opens a source stream for a given URN from a given list of providers.
Types ¶
type DestroyableFile ¶
func (*DestroyableFile) Destroy ¶
func (f *DestroyableFile) Destroy() error
type ErrorFunc ¶
type ErrorFunc func() *MultiError
type FileProvider ¶
func (FileProvider) Read ¶
func (fp FileProvider) Read(u *url.URL) (io.ReadCloser, error)
func (FileProvider) Schema ¶
func (FileProvider) Schema() []string
func (FileProvider) Write ¶
func (fp FileProvider) Write(u *url.URL) (WriteDestroyCloser, error)
type HTTPProvider ¶
HTTPProvider provides a source from an HTTP url
func (*HTTPProvider) Read ¶
func (p *HTTPProvider) Read(u *url.URL) (io.ReadCloser, error)
func (*HTTPProvider) Schema ¶
func (p *HTTPProvider) Schema() []string
type MultiError ¶
type MultiError struct {
// contains filtered or unexported fields
}
func Catch ¶
func Catch(mu *MultiError, err ...error) *MultiError
func (*MultiError) Append ¶
func (mu *MultiError) Append(err error)
func (*MultiError) AsError ¶
func (mu *MultiError) AsError() error
func (*MultiError) Catch ¶
func (mu *MultiError) Catch(funcs ...func() error) (failure bool)
func (*MultiError) CatchMulti ¶
func (mu *MultiError) CatchMulti(funcs ...ErrorFunc) (failure bool)
func (*MultiError) Error ¶
func (mu *MultiError) Error() string
func (*MultiError) Errors ¶
func (mu *MultiError) Errors() []error
type NoOpWriteDestroyCloser ¶
func (NoOpWriteDestroyCloser) Close ¶
func (NoOpWriteDestroyCloser) Close() error
func (NoOpWriteDestroyCloser) Destroy ¶
func (NoOpWriteDestroyCloser) Destroy() error
type PipeProvider ¶
type PipeProvider interface {
Source(u *url.URL) (*SourcePipe, error)
Target(u *url.URL) (*TargetPipe, error)
}
A PipeProvider is given a URL and should return a Source or Target pipe.
type S3Provider ¶
Provides files from an S3-like HTTP interface
func (S3Provider) Read ¶
func (p S3Provider) Read(u *url.URL) (io.ReadCloser, error)
func (S3Provider) Schema ¶
func (S3Provider) Schema() []string
func (S3Provider) Write ¶
func (p S3Provider) Write(u *url.URL) (WriteDestroyCloser, error)
type S3PutObject ¶
type S3PutObject struct {
// contains filtered or unexported fields
}
func (*S3PutObject) Close ¶
func (o *S3PutObject) Close() error
func (*S3PutObject) Destroy ¶
func (o *S3PutObject) Destroy() error
type SourcePipe ¶
type SourceProvider ¶
type Sources ¶
type Sources []*SourcePipe
func (Sources) Teardown ¶
func (s Sources) Teardown() (mu *MultiError)
type TargetPipe ¶
type TargetPipe struct {
Name string
Path string
URL *url.URL
Stream WriteDestroyCloser
}
type TargetProvider ¶
type TargetProvider interface {
Provider
Write(*url.URL) (WriteDestroyCloser, error)
}
type Targets ¶
type Targets []*TargetPipe
func (Targets) Teardown ¶
func (t Targets) Teardown() (mu *MultiError)
type Task ¶
type Task struct {
Call Call
// Preserve created target objects on failure
Preserve bool
MountDirectory string
Providers []Provider
// Sources provides a mapping of directory local named pipes to their equivalent URL
Sources UrlMapping
Targets UrlMapping
Stdin *Url
// Stdout is the target URL (if defined) for the output of the command
Stdout *Url
Stderr *Url
}
func (*Task) SetupInput ¶
func (t *Task) SetupInput() (io.ReadCloser, error)
func (*Task) SetupOutput ¶
func (t *Task) SetupOutput() (stdout WriteDestroyCloser, stderr WriteDestroyCloser, err error)
type TemplateGenerator ¶
type TemplateGenerator struct {
Provider PipeProvider
SourceTags UrlMapping
Sources Sources
TargetTags UrlMapping
Targets Targets
}
A TemplateGenerator replaces command-line argument values with a real location of a fifo on the file-system
type Url ¶
func (*Url) UnmarshalFlag ¶
type UrlMapping ¶
func (UrlMapping) UnmarshalFlag ¶
func (m UrlMapping) UnmarshalFlag(value string) error
UnmarshalFlag implements un-marshalling a flag value into the URL mapping. Where the format is key:url
type WriteDestroyCloser ¶
type WriteDestroyCloser interface {
io.WriteCloser
// Teardown is called when the command fails, signalling that the object should be removed.
// Closer must be closed before calling abort.
Destroy() error
}
func ProvideTarget ¶
func ProvideTarget(u *url.URL, providers ...Provider) (WriteDestroyCloser, error)
Click to show internal directories.
Click to hide internal directories.