Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mode ¶
type Mode string
Mode defines the server's running mode.
const ( // ModeTLSSelfSigned runs the server using a self-signed TLS certificate (localhost or testing use). ModeTLSSelfSigned Mode = "self-signed" // ModeTLSEncrypt runs the server using a Let's Encrypt certificate (automatic certificate management). ModeTLSEncrypt Mode = "encrypt" // ModeTLSExternal runs the server using user-provided TLS certificate and key files. ModeTLSExternal Mode = "external" // ModeRemoteAPI runs the server using remote API to manage TLS certificate. ModeRemoteAPI = "remote-api" )
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server TLS server.
type TLSAutoEncryptConfig ¶
type TLSAutoEncryptConfig struct {
// contains filtered or unexported fields
}
func NewTLSEAutoEncryptConfig ¶
func NewTLSEAutoEncryptConfig(domain string, email string, opts ...TLSEncryptOption) *TLSAutoEncryptConfig
func (*TLSAutoEncryptConfig) Validate ¶
func (c *TLSAutoEncryptConfig) Validate() error
type TLSEncryptOption ¶
type TLSEncryptOption func(*tlsEncryptOptions)
TLSEncryptOption set tlsEncryptOptions.
func WithTLSEncryptCacheDir ¶
func WithTLSEncryptCacheDir(cacheDir string) TLSEncryptOption
WithTLSEncryptCacheDir sets the directory to store Let's Encrypt certificates.
func WithTLSEncryptEnableRedirect ¶
func WithTLSEncryptEnableRedirect(httpAddr ...string) TLSEncryptOption
WithTLSEncryptEnableRedirect enables the HTTP-to-HTTPS redirect service. By default, it listens on ":80". An optional httpAddr can be provided to specify a different address.
type TLSExternalConfig ¶
type TLSExternalConfig struct {
// contains filtered or unexported fields
}
func NewTLSExternalConfig ¶
func NewTLSExternalConfig(certFile, keyFile string) *TLSExternalConfig
func (*TLSExternalConfig) Validate ¶
func (c *TLSExternalConfig) Validate() error
type TLSRemoteAPIConfig ¶
type TLSRemoteAPIConfig struct {
// contains filtered or unexported fields
}
TLSRemoteAPIConfig implements certificate retrieval from other service API
func NewTLSRemoteAPIConfig ¶
func NewTLSRemoteAPIConfig(url string, opts ...TLSRemoteAPIOption) *TLSRemoteAPIConfig
func (*TLSRemoteAPIConfig) Validate ¶
func (c *TLSRemoteAPIConfig) Validate() error
type TLSRemoteAPIOption ¶
type TLSRemoteAPIOption func(*tlsRemoteAPIOptions)
TLSRemoteAPIOption set tlsRemoteAPIOptions.
func WithTLSRemoteAPICacheDir ¶
func WithTLSRemoteAPICacheDir(cacheDir string) TLSRemoteAPIOption
WithTLSRemoteAPICacheDir set cacheDir for tlsRemoteAPI.
func WithTLSRemoteAPIHeaders ¶
func WithTLSRemoteAPIHeaders(headers map[string]string) TLSRemoteAPIOption
WithTLSRemoteAPIHeaders set headers for tlsRemoteAPI.
func WithTLSRemoteAPITimeout ¶
func WithTLSRemoteAPITimeout(timeout time.Duration) TLSRemoteAPIOption
WithTLSRemoteAPITimeout set timeout for tlsRemoteAPI.
type TLSRemoteAPIResponse ¶
type TLSSelfSignedConfig ¶
type TLSSelfSignedConfig struct {
// contains filtered or unexported fields
}
func NewTLSSelfSignedConfig ¶
func NewTLSSelfSignedConfig(opts ...TLSSelfSignedOption) *TLSSelfSignedConfig
func (*TLSSelfSignedConfig) Validate ¶
func (c *TLSSelfSignedConfig) Validate() error
type TLSSelfSignedOption ¶
type TLSSelfSignedOption func(*tlsSelfSignedOptions)
TLSSelfSignedOption set tlsSelfSignedOptions.
func WithTLSSelfSignedCacheDir ¶
func WithTLSSelfSignedCacheDir(cacheDir string) TLSSelfSignedOption
WithTLSSelfSignedCacheDir sets the cache directory for self-signed certificates.
func WithTLSSelfSignedExpirationDays ¶
func WithTLSSelfSignedExpirationDays(expirationDays int) TLSSelfSignedOption
WithTLSSelfSignedExpirationDays sets the expiration days for self-signed certificates.
func WithTLSSelfSignedWanIPs ¶
func WithTLSSelfSignedWanIPs(wanIPs ...string) TLSSelfSignedOption
WithTLSSelfSignedWanIPs sets the IP addresses to include in the certificate.