util

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOG_LEVEL_DEBUG = "DEBUG"
	LOG_LEVEL_INFO  = "INFO"
	LOG_LEVEL_WARN  = "WARN"
	LOG_LEVEL_ERROR = "ERROR"
)

Variables

This section is empty.

Functions

func FormatFileSize

func FormatFileSize(bytes int64) string

ByteSize returns a human-readable byte size string.

func FormatFileSizeInt

func FormatFileSizeInt(bytes int) string

func NewLogger

func NewLogger(conf LogConfig) *slog.Logger

Types

type LogConfig

type LogConfig struct {
	Filename   string `toml:"filename"`
	Level      string `toml:"level"`
	MaxSize    int    `toml:"max_size"`
	MaxAge     int    `toml:"max_age"`
	MaxBackups int    `toml:"max_backups"`
	Compress   bool   `toml:"compress,omitempty"`
	Chown      string `toml:"chown,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL