Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithEnv ¶
func WithEnv() func(*ClientConfig)
func WithFile ¶
func WithFile() func(cfg *ClientConfig)
Types ¶
type ClientConfig ¶
type ClientConfig struct { File string `env:"CLIENT_CONFIG_FILE" envDefault:"client.yml"` API struct { Host string `json:"host" yaml:"host" env:"API_HOST"` Port int `json:"port" yaml:"port" env:"API_PORT" envDefault:"8081"` Route string `json:"route" yaml:"route" env:"API_ROUTE" envDefault:"/api/v1"` Secure bool `json:"secure" yaml:"secure" env:"CLIENT_SECURE"` } `json:"api" yaml:"api"` Cert struct { CA string `json:"ca" yaml:"ca" env:"CA_PATH"` Cert string `json:"cert" yaml:"cert" env:"CLIENT_CERT_PATH"` Key string `json:"key" yaml:"key" env:"CLIENT_KEY_PATH"` } `json:"cert" yaml:"cert"` }
func New ¶
func New(opts ...func(*ClientConfig)) *ClientConfig
func (*ClientConfig) GetAPIAddress ¶
func (c *ClientConfig) GetAPIAddress() string
func (*ClientConfig) GetCACertPool ¶
func (c *ClientConfig) GetCACertPool() (*x509.CertPool, error)
func (*ClientConfig) GetCertificate ¶
func (c *ClientConfig) GetCertificate() (tls.Certificate, error)
Click to show internal directories.
Click to hide internal directories.