mirror of
https://github.com/drone/drone-cli.git
synced 2026-01-20 18:01:34 +01:00
30 lines
533 B
Go
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
|
|
}
|
|
}
|
|
}
|