package
0.0.0-20231013025015-df225fcd9425
Repository: https://github.com/ccmonky/pkg.git
Documentation: pkg.go.dev
# Functions
BackupName defines the backup name for gaode.
NewBackupNaming creates a new backup naming rule.
NewTimedRotatingLogger creates new TimedRotatingLogger.
TimeFromName extract time from backup name for gaode.
WithCron 设定cron调度器.
WithCronSpec set cron expression, refer to `https://www.godoc.org/github.com/robfig/cron`.
ZapAnyN like zap.Any, but limit to n bytes for non-primitive type values.
ZapJSON zap.Field will marshal obj as json to record.
ZapRequestID `zap.Field` to record request id which will get from `http.Request`.
# Variables
GetReqID short name for GetRequestID.
No description provided by the author
RequestIDName field name of request id in log.
ZapReqID short name for ZapRequestID.
# Structs
BackupNaming defines the backup name rule by defining the backup time format, name generator and parser.
Logger is an io.WriteCloser that writes to the specified filename.
Options defines the options for TimedRotatingLogger.
TimedRotatingLogger rotates log according to cron expression.
# Type aliases
BackupNameFunc creates a new filename from the given name, inserting a timestamp between the filename and the extension, using the local time if requested (otherwise UTC).
Option defines the option func.
TimeFromNameFunc extracts the formatted time from the filename by stripping off the filename's prefix and extension.