add context option on runtime
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package runtime
|
package runtime
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/micro/cli/v2"
|
||||||
gorun "github.com/micro/go-micro/v2/runtime"
|
gorun "github.com/micro/go-micro/v2/runtime"
|
||||||
"github.com/owncloud/ocis-pkg/v2/log"
|
"github.com/owncloud/ocis-pkg/v2/log"
|
||||||
)
|
)
|
||||||
@@ -10,6 +11,7 @@ type Options struct {
|
|||||||
Services []string
|
Services []string
|
||||||
Logger log.Logger
|
Logger log.Logger
|
||||||
MicroRuntime *gorun.Runtime
|
MicroRuntime *gorun.Runtime
|
||||||
|
Context *cli.Context
|
||||||
}
|
}
|
||||||
|
|
||||||
// Option undocummented
|
// Option undocummented
|
||||||
@@ -46,3 +48,10 @@ func MicroRuntime(rt *gorun.Runtime) Option {
|
|||||||
o.MicroRuntime = rt
|
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