micro-config-consul/options.go
Vasiliy Tolstov 4c529af53f add feature tls config stuff
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-12-09 13:21:48 +03:00

39 lines
677 B
Go

package consul
import (
"github.com/hashicorp/consul/api"
"github.com/unistack-org/micro/v3/config"
)
type configKey struct{}
func Config(cfg *api.Config) config.Option {
return config.SetOption(configKey{}, cfg)
}
type tokenKey struct{}
func Token(token string) config.Option {
return config.SetOption(tokenKey{}, token)
}
type addrKey struct{}
func Address(addr string) config.Option {
return config.SetOption(addrKey{}, addr)
}
type pathKey struct{}
func Path(path string) config.Option {
return config.SetOption(pathKey{}, path)
}
/*
type tlsConfigKey struct{}
func TLSConfig(t *tls.Config) config.Option {
return config.SetOption(tlsConfigKey{}, t)
}
*/