mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-03 02:39:52 -06:00
add context option on runtime
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package runtime
|
||||
|
||||
import (
|
||||
"github.com/micro/cli/v2"
|
||||
gorun "github.com/micro/go-micro/v2/runtime"
|
||||
"github.com/owncloud/ocis-pkg/v2/log"
|
||||
)
|
||||
@@ -10,6 +11,7 @@ type Options struct {
|
||||
Services []string
|
||||
Logger log.Logger
|
||||
MicroRuntime *gorun.Runtime
|
||||
Context *cli.Context
|
||||
}
|
||||
|
||||
// Option undocummented
|
||||
@@ -46,3 +48,10 @@ func MicroRuntime(rt *gorun.Runtime) Option {
|
||||
o.MicroRuntime = rt
|
||||
}
|
||||
}
|
||||
|
||||
// Context option
|
||||
func Context(c *cli.Context) Option {
|
||||
return func(o *Options) {
|
||||
o.Context = c
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user