mirror of
https://github.com/linka-cloud/grpc.git
synced 2025-06-22 09:12:28 +00:00
service: replace cmd with NewFlagSet, add internal service version metadata interceptors
client: add NewFlagSet, add missing Options interface methods Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
@ -61,6 +61,7 @@ type Options interface {
|
||||
Address() string
|
||||
|
||||
Reflection() bool
|
||||
Health() bool
|
||||
|
||||
CACert() string
|
||||
Cert() string
|
||||
@ -103,6 +104,7 @@ func NewOptions() *options {
|
||||
return &options{
|
||||
ctx: context.Background(),
|
||||
address: ":0",
|
||||
health: true,
|
||||
}
|
||||
}
|
||||
|
||||
@ -161,6 +163,12 @@ func WithReflection(r bool) Option {
|
||||
}
|
||||
}
|
||||
|
||||
func WithHealth(h bool) Option {
|
||||
return func(o *options) {
|
||||
o.health = h
|
||||
}
|
||||
}
|
||||
|
||||
func WithSecure(s bool) Option {
|
||||
return func(o *options) {
|
||||
o.secure = s
|
||||
@ -351,6 +359,7 @@ type options struct {
|
||||
address string
|
||||
|
||||
reflection bool
|
||||
health bool
|
||||
|
||||
secure bool
|
||||
caCert string
|
||||
@ -413,6 +422,10 @@ func (o *options) Reflection() bool {
|
||||
return o.reflection
|
||||
}
|
||||
|
||||
func (o *options) Health() bool {
|
||||
return o.health
|
||||
}
|
||||
|
||||
func (o *options) CACert() string {
|
||||
return o.caCert
|
||||
}
|
||||
|
Reference in New Issue
Block a user