Documentation ¶
Index ¶
- func CheckIPinAccessList(ip net.IP, ipAccessList string) bool
- func GetCurrentTimeMilliseconds() int64
- func LoadYAMLConfiguration(filename *string, config interface{}) (interface{}, error)
- func NewLogger(applicationName string, config *Logger) *zap.Logger
- func ServeEmbedDirectory(filesystem fs.FS, embedPath string) gin.HandlerFunc
- func ServeEmbedFile(filesystem fs.FS, embedFilePath string) gin.HandlerFunc
- func TimeMillisecondsToInt64(timestamp time.Time) int64
- func TimeMillisecondsToString(timestamp int64) string
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIPinAccessList ¶
CheckIPinAccessList checks if ip addresses is in one of the subnets of IP ACL
func GetCurrentTimeMilliseconds ¶
func GetCurrentTimeMilliseconds() int64
GetCurrentTimeMilliseconds returns current epoch time in milliseconds
func LoadYAMLConfiguration ¶
LoadYAMLConfiguration loads a configuration file and parses it as YAML
func ServeEmbedDirectory ¶
func ServeEmbedDirectory(filesystem fs.FS, embedPath string) gin.HandlerFunc
ServeEmbedDirectory serves a directory from an embedded filesystem, directory must provided via gin's URL param field ":path"
func ServeEmbedFile ¶
func ServeEmbedFile(filesystem fs.FS, embedFilePath string) gin.HandlerFunc
ServeEmbedFile serves one file from an embedded filesystem
func TimeMillisecondsToInt64 ¶
TimeMillisecondsToInt64 returns time.Time as int64, if not set -1 will be returned
func TimeMillisecondsToString ¶
TimeMillisecondsToString return timestamp as string in UTC
Types ¶
type Logger ¶
type Logger struct { // Logging level of this logger Level string // Filename is the file to write logs to. Backup log files will be retained // in the same directory. Filename string // MaxSize is the maximum size in megabytes of the log file before it gets // rotated. It defaults to 100 megabytes. MaxSize int // MaxAge is the maximum number of days to retain old log files based on the // timestamp encoded in their filename. Note that a day is defined as 24 // hours and may not exactly correspond to calendar days due to daylight // savings, leap seconds, etc. The default is not to remove old log files // based on age. MaxAge int // MaxBackups is the maximum number of old log files to retain. The default // is to retain all old log files (though MaxAge may still cause them to get // deleted.) MaxBackups int // contains filtered or unexported fields }
Logger holds our log file configuration
Click to show internal directories.
Click to hide internal directories.