config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CheckAnimDuration  = 290 * time.Millisecond
	DeleteAnimDuration = 200 * time.Millisecond
	FPS                = 60
)

Variables

View Source
var (
	StorageType = "file" // file, s3, mongodb, postgres

	// Log rotation configuration
	LogMaxSize     = int64(10 * 1024 * 1024) // 10MB max size per log file
	LogMaxFiles    = 5                       // Keep 5 log files
	LogCompressOld = true                    // Compress old log files
)

Functions

This section is empty.

Types

type LogFileInfo

type LogFileInfo struct {
	Path    string
	Size    int64
	ModTime time.Time
}

LogFileInfo contains information about a log file

type LogRotator

type LogRotator struct {
	// contains filtered or unexported fields
}

LogRotator handles log file rotation based on size and file count limits

func NewLogRotator

func NewLogRotator(logPath string, maxSize int64, maxFiles int, compressOld bool) *LogRotator

NewLogRotator creates a new log rotator

func (*LogRotator) GetLogFiles

func (lr *LogRotator) GetLogFiles() ([]LogFileInfo, error)

GetLogFiles returns information about current log files

type RotatingWriter

type RotatingWriter struct {
	Writer  io.Writer
	Rotator *LogRotator
}

RotatingWriter wraps an io.Writer and performs rotation when needed

func NewRotatingWriter

func NewRotatingWriter(writer io.Writer, rotator *LogRotator) *RotatingWriter

NewRotatingWriter creates a new rotating writer

func (*RotatingWriter) Write

func (rw *RotatingWriter) Write(p []byte) (n int, err error)

Write implements io.Writer with rotation checking

Jump to

Keyboard shortcuts

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