1
0
mirror of https://github.com/drone/drone-cli.git synced 2026-01-20 09:51:34 +01:00
drone-cli/vendor/github.com/drone/drone-runtime/runtime/option.go
2018-10-09 11:18:46 -07:00

30 lines
533 B
Go

package runtime
import "github.com/drone/drone-runtime/engine"
// Option configures a Runtime option.
type Option func(*Runtime)
// WithEngine sets the Runtime engine.
func WithEngine(e engine.Engine) Option {
return func(r *Runtime) {
r.engine = e
}
}
// WithConfig sets the Runtime configuration.
func WithConfig(c *engine.Spec) Option {
return func(r *Runtime) {
r.config = c
}
}
// WithHooks sets the Runtime tracer.
func WithHooks(h *Hook) Option {
return func(r *Runtime) {
if h != nil {
r.hook = h
}
}
}