Client Cache

This commit is contained in:
Ben Toogood
2020-05-22 16:52:24 +01:00
parent 0615fe825f
commit 7d7f4046e8
6 changed files with 130 additions and 3 deletions

View File

@@ -471,9 +471,12 @@ func (c *cmd) Before(ctx *cli.Context) error {
var serverOpts []server.Option
var clientOpts []client.Option
// setup a client to use when calling the runtime
// setup a client to use when calling the runtime. It is important the auth client is wrapped
// after the cache client since the wrappers are applied in reverse order and the cache will use
// some of the headers set by the auth client.
authFn := func() auth.Auth { return *c.opts.Auth }
microClient := wrapper.AuthClient(authFn, grpc.NewClient())
microClient := wrapper.CacheClient(grpc.NewClient())
microClient = wrapper.AuthClient(authFn, microClient)
// Set the store
if name := ctx.String("store"); len(name) > 0 {