Documentation ¶
Index ¶
- func GetCertificateFunc(m *autocert.Manager, devCertFile, devKeyFile string) func(*tls.ClientHelloInfo) (*tls.Certificate, error)
- func GetCertificateFuncFromFiles(certFile, keyFile string) func(*tls.ClientHelloInfo) (*tls.Certificate, error)
- func GetCertificateFuncFromLetsEncrypt(m *autocert.Manager) func(*tls.ClientHelloInfo) (*tls.Certificate, error)
- func GetDevelopmentCert(certFile, keyFile string) func(*tls.ClientHelloInfo) (*tls.Certificate, error)
- func GetenvDefault(key, defaultValue string) string
- func GoodTLSConfig(src *tls.Config) *tls.Config
- func IsCI() bool
- func IsDevelopment() bool
- func IsProduction() bool
- func Must[T any](value T, err error) T
- func RandInt64() (int64, error)
- func TLSConfig(getCertificate func(*tls.ClientHelloInfo) (*tls.Certificate, error)) *tls.Config
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCertificateFunc ¶ added in v0.0.6
func GetCertificateFunc(m *autocert.Manager, devCertFile, devKeyFile string) func(*tls.ClientHelloInfo) (*tls.Certificate, error)
func GetCertificateFuncFromFiles ¶ added in v0.0.6
func GetCertificateFuncFromFiles(certFile, keyFile string) func(*tls.ClientHelloInfo) (*tls.Certificate, error)
func GetCertificateFuncFromLetsEncrypt ¶ added in v0.0.6
func GetCertificateFuncFromLetsEncrypt(m *autocert.Manager) func(*tls.ClientHelloInfo) (*tls.Certificate, error)
func GetDevelopmentCert ¶ added in v0.0.8
func GetDevelopmentCert(certFile, keyFile string) func(*tls.ClientHelloInfo) (*tls.Certificate, error)
func GetenvDefault ¶ added in v0.0.3
GetenvDefault returns the value of environment variable called by key. If the value is undefined or in other words empty, then value of given defaultValue is returned.
func IsCI ¶ added in v0.0.5
func IsCI() bool
IsCI returns true if environment variable CI has value true and false otherwise.
func IsDevelopment ¶ added in v0.0.4
func IsDevelopment() bool
IsDevelopment checks environment variable ENV and returns true only if ENV value is `development`.
func IsProduction ¶ added in v0.0.4
func IsProduction() bool
IsProduction checks the value of environment variable ENV and returns true if value is `production`.
func Must ¶
Must checks for given err. If err is not nil panic is called, otherwise returns value T.
func RandInt64 ¶
RandInt64 returns cryptographically secure random number suitable for seeding the pseudo-random number generator math/rand.Seed.
func TLSConfig ¶
func TLSConfig(getCertificate func(*tls.ClientHelloInfo) (*tls.Certificate, error)) *tls.Config
TLSConfig returns secure TLS configuration for Internet server.
Types ¶
type Logger ¶
Logger implements a common logger interaface compatible with standard log.Logger.