mirror of
https://github.com/go-micro/go-micro.git
synced 2025-04-23 11:07:43 +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:
parent
77bf39f2cd
commit
270d910b73
13
cmd/cmd.go
13
cmd/cmd.go
@ -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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user