mirror of
https://github.com/go-micro/go-micro.git
synced 2025-02-16 18:34:33 +02:00
Command Option add NewConfig,NewProfile func (#2276)
* 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 * Add AuthCall wrapper func * Add NewConfig func * Add NewProfile func
This commit is contained in:
parent
a65932ff82
commit
066ce5045b
@ -2,7 +2,6 @@ package cmd
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/asim/go-micro/v3/auth"
|
||||
"github.com/asim/go-micro/v3/broker"
|
||||
"github.com/asim/go-micro/v3/cache"
|
||||
@ -226,3 +225,17 @@ func NewAuth(name string, t func(...auth.Option) auth.Auth) Option {
|
||||
o.Auths[name] = t
|
||||
}
|
||||
}
|
||||
|
||||
// New config func
|
||||
func NewConfig(name string, t func(...config.Option) (config.Config, error)) Option {
|
||||
return func(o *Options) {
|
||||
o.Configs[name] = t
|
||||
}
|
||||
}
|
||||
|
||||
// New profile func
|
||||
func NewProfile(name string, t func(...profile.Option) profile.Profile) Option {
|
||||
return func(o *Options) {
|
||||
o.Profiles[name] = t
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user