Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FlagEnvConfigLoader ¶
type FlagEnvConfigLoader struct { // Source: env/flag Source SourceType // EnableTLSFlag enables TLS flag EnableTLSFlag bool // TLSConfig can be overridden in the initial stage of a bean TLSConfig }
FlagEnvConfigLoader provides the function of obtaining config from command flags and environment variables.
func (*FlagEnvConfigLoader) Process ¶
Process Configuration Load. The env/envflag type config is obtained from the environment variable, and the value in the envflag type config is processed and replaced according to the priority.
func (*FlagEnvConfigLoader) RegisterFlags ¶
RegisterFlags registers flags.
func (*FlagEnvConfigLoader) RegisterTLSFlag ¶
func (c *FlagEnvConfigLoader) RegisterTLSFlag(name string, fs *pflag.FlagSet)
RegisterTLSFlag registers TLS Flag.
type SourceType ¶
type SourceType string
const ( SourceFlag SourceType = "flag" SourceEnv SourceType = "env" )
type TLSConfig ¶
type TLSConfig struct { EnableTLS bool CAPath string ServerCertPath string ServerKeyPath string ClientCertPath string ClientKeyPath string }
TLSConfig defines tls config info.
func (*TLSConfig) InitTLSConfig ¶
func (c *TLSConfig) InitTLSConfig(enableTLS bool, caPath, serverCertPath, serverKeyPath, clientCertPath, clientKeyPath string)
InitTLSConfig used to init tls config.
func (*TLSConfig) InstallPFlags ¶
InstallPFlags used to install pflags.
func (*TLSConfig) LoadServerTLSConfig ¶
LoadServerTLSConfig loads server tls config.
func (*TLSConfig) TLSEnabled ¶
TLSEnabled checks if tls is enabled.
type TLSServerConfig ¶
type TLSServerConfig struct { ServerCertFile string `yaml:"serverCertFile,omitempty"` ServerCertData string `yaml:"serverCertData,omitempty"` ServerKeyFile string `yaml:"serverKeyFile,omitempty"` ServerKeyData string `yaml:"serverKeyData,omitempty"` RootCA *x509.Certificate `yaml:"-"` RootCAKey *rsa.PrivateKey `yaml:"-"` ServerCert *x509.Certificate `yaml:"-"` ServerKey *rsa.PrivateKey `yaml:"-"` CommonName string `yaml:"-"` }
func (*TLSServerConfig) GenerateServerKeyCerts ¶
func (t *TLSServerConfig) GenerateServerKeyCerts(commonName string, ipList []string, dnsList []string) error
func (*TLSServerConfig) LoadFromDataOrFile ¶
func (t *TLSServerConfig) LoadFromDataOrFile(ipList, dnsList []string) error
Click to show internal directories.
Click to hide internal directories.