add feature tls config stuff

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-12-09 13:21:48 +03:00
parent 883757b7f8
commit 4c529af53f
2 changed files with 13 additions and 0 deletions

View File

@ -59,6 +59,11 @@ func (c *consulConfig) Init(opts ...config.Option) error {
if v, ok := c.opts.Context.Value(pathKey{}).(string); ok { if v, ok := c.opts.Context.Value(pathKey{}).(string); ok {
path = v path = v
} }
/*
if v, ok := c.opts.Context.Value(tlsConfigKey{}).(*tls.Config); ok {
cfg.TLSConfig = *v
}
*/
} }
cli, err := api.NewClient(cfg) cli, err := api.NewClient(cfg)

View File

@ -28,3 +28,11 @@ type pathKey struct{}
func Path(path string) config.Option { func Path(path string) config.Option {
return config.SetOption(pathKey{}, path) return config.SetOption(pathKey{}, path)
} }
/*
type tlsConfigKey struct{}
func TLSConfig(t *tls.Config) config.Option {
return config.SetOption(tlsConfigKey{}, t)
}
*/