1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-02-04 18:21:53 +02:00

Add config command option automatically discover (#2246)

* Add grpc,memory,quic transport automatically discover

* Add grpc,memory,quic transport automatically discover

* Add jwt auth automatically discover

* Add jwt auth automatically discover

* Add config command option automatically discover
This commit is contained in:
simon 2021-09-04 14:17:21 +08:00 committed by GitHub
parent 77bf39f2cd
commit 270d910b73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -612,6 +612,19 @@ func (c *cmd) Before(ctx *cli.Context) error {
}
}
// config
if name := ctx.String("config"); len(name) > 0 {
// only change if we have the server and type differs
if r, ok := c.opts.Configs[name]; ok {
rc , err := r()
if err != nil {
logger.Fatalf("Error configuring config: %v", err)
}
*c.opts.Config = rc
}
}
return nil
}