add context option on runtime

This commit is contained in:
A.Unger
2020-03-17 14:59:37 +01:00
parent c76f1413d3
commit ca17f2da9e

View File

@@ -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
}
}