2017-04-14 15:39:32 -03:00
|
|
|
// Package pipeline provides a generic pipe interface.
|
2016-12-30 09:27:35 -02:00
|
|
|
package pipeline
|
|
|
|
|
2017-08-20 16:37:52 -03:00
|
|
|
import "github.com/goreleaser/goreleaser/context"
|
2016-12-30 09:27:35 -02:00
|
|
|
|
2016-12-30 12:41:59 -02:00
|
|
|
// Pipe interface
|
2016-12-30 09:27:35 -02:00
|
|
|
type Pipe interface {
|
2016-12-30 12:41:59 -02:00
|
|
|
// Name of the pipe
|
2017-01-14 15:14:35 -02:00
|
|
|
Description() string
|
2016-12-30 12:41:59 -02:00
|
|
|
|
|
|
|
// Run the pipe
|
2017-01-14 14:06:57 -02:00
|
|
|
Run(ctx *context.Context) error
|
2016-12-30 09:27:35 -02:00
|
|
|
}
|
2017-08-20 16:35:46 -03:00
|
|
|
|
|
|
|
// ErrSkip occurs when a pipe is skipped for some reason
|
|
|
|
type ErrSkip struct {
|
|
|
|
reason string
|
|
|
|
}
|
|
|
|
|
|
|
|
// Error implements the error interface. returns the reason the pipe was skipped
|
|
|
|
func (e ErrSkip) Error() string {
|
|
|
|
return e.reason
|
|
|
|
}
|
|
|
|
|
|
|
|
// Skip skips this pipe with the given reason
|
|
|
|
func Skip(reason string) ErrSkip {
|
|
|
|
return ErrSkip{reason}
|
|
|
|
}
|