Documentation
¶
Index ¶
- func CreateNonExistingFolder(path string, mode fs.FileMode) error
- func FileExists(filename string) bool
- func FormatFilePath(path string) string
- func GenerateCSRAndPrivateKey(privateKey, keyType, domain string, SAN []string) (string, []byte, error)
- func GenerateFingerprint(content []byte) string
- func GenerateRequestID() string
- func GetKeyType(keyTypeStr string) (certcrypto.KeyType, error)
- func GetRequestID(ctx context.Context) string
- func LoggerWithRequestID(ctx context.Context, logger log.Logger) log.Logger
- func RandomStringCrypto(length int) (string, error)
- func RandomWeekdayBeforeExpiration(expiration time.Time, minDays, maxDays int) time.Time
- func RequestLogHook(logger *logrus.Logger) retryablehttp.RequestLogHook
- func ResponseLogHook(logger *logrus.Logger, logJSONBody bool) retryablehttp.ResponseLogHook
- func ResponseLogHookDebug(logger *logrus.Logger) retryablehttp.ResponseLogHook
- func SHA1Hash(content string) string
- func SanitizedDomain(logger log.Logger, domain string) string
- func SetTLSConfig(cert string, key string, ca string, insecure bool) (*tls.Config, error)
- func SetupLoggers(logLevel, logFormat string) (log.Logger, *logrus.Logger)
- func StructToMapInterface(data interface{}) map[string]interface{}
- func ValidateLabels(labels string) (errors []error)
- func ValidateRenewalDays(value string) (int, int, error)
- func WithRequestID(ctx context.Context, requestID string) context.Context
- type CustomTextFormatter
- type CustomWriter
- type DebugLevelHook
- type UTCFormatter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileExists ¶
func FormatFilePath ¶
func GenerateCSRAndPrivateKey ¶
func GenerateCSRAndPrivateKey(privateKey, keyType, domain string, SAN []string) (string, []byte, error)
GenerateCSRAndPrivateKey generates a Certificate Signing Request (CSR) and a private key.
func GenerateFingerprint ¶
func GenerateRequestID ¶ added in v0.6.4
func GenerateRequestID() string
GenerateRequestID generates a unique request ID using crypto/rand
func GetKeyType ¶
func GetKeyType(keyTypeStr string) (certcrypto.KeyType, error)
GetKeyType the type from which private keys should be generated.
func GetRequestID ¶ added in v0.6.4
GetRequestID retrieves the request ID from the context
func LoggerWithRequestID ¶ added in v0.6.4
LoggerWithRequestID returns a logger with the request ID from context
func RandomStringCrypto ¶
func RandomWeekdayBeforeExpiration ¶
Function to generate a random weekday within a given range before an expiration date
func RequestLogHook ¶
func RequestLogHook(logger *logrus.Logger) retryablehttp.RequestLogHook
RequestLogHook logs outgoing HTTP requests
func ResponseLogHook ¶
func ResponseLogHook(logger *logrus.Logger, logJSONBody bool) retryablehttp.ResponseLogHook
ResponseLogHook logs the response status code and body
func ResponseLogHookDebug ¶
func ResponseLogHookDebug(logger *logrus.Logger) retryablehttp.ResponseLogHook
ResponseLogHookDebug logs all responses with full details
func SanitizedDomain ¶
SanitizedDomain Make sure no funny chars are in the cert names (like wildcards ;)).
func SetTLSConfig ¶
func SetupLoggers ¶ added in v0.7.1
SetupLoggers creates and configures all loggers (logrus, go-kit, and lego slog). Returns the go-kit logger and logrus logger.
func StructToMapInterface ¶
func StructToMapInterface(data interface{}) map[string]interface{}
func ValidateLabels ¶
Types ¶
type CustomTextFormatter ¶
type CustomTextFormatter struct {
TimestampFormat string
CallerPrettyfier func(*runtime.Frame) (string, string)
}
CustomTextFormatter is a custom logrus formatter
type CustomWriter ¶
Custom Writer to block INFO messages containg [DEBUG] in message
type DebugLevelHook ¶
Hook to redirect logs with message starting with [DEBUG] from INFO to DEBUG level
func (*DebugLevelHook) Levels ¶
func (hook *DebugLevelHook) Levels() []logrus.Level