Documentation ¶
Index ¶
- Constants
- func ParseSSLCert(path string, certEnv string) ([]byte, error)
- func ParseSSLCertAndKey(certEnv string, keyEnv string) (cert []byte, key []byte, err error)
- func SSLCertAndKeyEnvUsage(certEnv string, keyEnv string) string
- func SSLCertEnvUsage(f string, certEnv string) string
- type Flag
- type Set
Constants ¶
const ( FlagName = "ssl-cert-file" // The flag name CertEnvName = "PCAS_SSL_CERT" // The env var name for the certificate )
SSL certificates
const ( SetName = "SSL private key" KeyCertEnvName = "PCAS_SSL_KEY_CERT" // The env var name for the key's certificate KeyEnvName = "PCAS_SSL_KEY" // The env var name for the key )
SSL key and certificate pairs
Variables ¶
This section is empty.
Functions ¶
func ParseSSLCert ¶
ParseSSLCert loads the SSL certificates from the file with given path. If the environment variable certEnv is set, the SSL certificates in certEnv will also be loaded.
func ParseSSLCertAndKey ¶
ParseSSLCertAndKey loads the SSL certificate and key pair, with the certificate read from the environment variable certEnv, and the key read from the environment variable keyEnv. On return, the environment variable keyEnv will be unset.
func SSLCertAndKeyEnvUsage ¶
SSLCertAndKeyEnvUsage returns a standard usage message for the SSL certificate and key pair. The SSL certificate will be read from the environment variable certEnv (if set), and the SSL key will be read from the environment variable keyEnv (if set).
func SSLCertEnvUsage ¶
SSLCertEnvUsage returns a standard usage message for the SSL certificate flag -f. SSL certificates will be read from the contents of the file at path specified by -f (if set), along with the environment variable certEnv (if set).
Types ¶
type Flag ¶
type Flag struct {
// contains filtered or unexported fields
}
Flag is the standard command-line flag for obtaining an SSL certificate.
func (*Flag) Certificate ¶
Certificate returns the SSL certificate. This should only be called after the flags have been parsed.
func (*Flag) Description ¶
Description returns a one-line description of this variable.
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set is the standard command-line set for obtaining an SSL key and corresponding certificate.
func (*Set) Certificate ¶
Certificate returns the SSL certificate. This should only be called after a successful call to Validate.
func (*Set) Key ¶
Key returns the SSL key. This should only be called after a successful call to Validate.
func (*Set) RequireCertAndKey ¶
RequireCertAndKey returns the SSL certificate and key pair, or an error if either is not set. This should only be called after a successful call to Validate.
func (*Set) UsageFooter ¶
UsageFooter returns the footer for the usage message for this flag set.
func (*Set) UsageHeader ¶
UsageHeader returns the header for the usage message for this flag set.