woodpecker/pipeline/option.go
Jacob Floyd e34daae0cf
Move cncd/pipeline/pipeline/ to pipeline/ (#347)
* Refactor: move cncd/pipeline/ to pipeline/

* Refactor: move pipeline/pipeline/ to pipeline/
2021-09-24 13:18:34 +02:00

39 lines
803 B
Go

package pipeline
import (
"context"
"github.com/woodpecker-ci/woodpecker/pipeline/backend"
)
// Option configures a runtime option.
type Option func(*Runtime)
// WithEngine returns an option configured with a runtime engine.
func WithEngine(engine backend.Engine) Option {
return func(r *Runtime) {
r.engine = engine
}
}
// WithLogger returns an option configured with a runtime logger.
func WithLogger(logger Logger) Option {
return func(r *Runtime) {
r.logger = logger
}
}
// WithTracer returns an option configured with a runtime tracer.
func WithTracer(tracer Tracer) Option {
return func(r *Runtime) {
r.tracer = tracer
}
}
// WithContext returns an option configured with a context.
func WithContext(ctx context.Context) Option {
return func(r *Runtime) {
r.ctx = ctx
}
}