From ca17f2da9e2adf8289518003eb7dceb18fcc8019 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Tue, 17 Mar 2020 14:59:37 +0100 Subject: [PATCH] add context option on runtime --- pkg/micro/runtime/options.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/micro/runtime/options.go b/pkg/micro/runtime/options.go index 513d86aa3c..bfead76a50 100644 --- a/pkg/micro/runtime/options.go +++ b/pkg/micro/runtime/options.go @@ -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 + } +}