archive

package
v1.28.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CompressSuffix             = ".gz"
	BackupTimeFmt              = "2006-01-02T15-04-05.000"
	DirName                    = "archive"
	ScanInterval               = 5 * time.Second
	LogFilePerm    os.FileMode = 0o640
	LogDirPerm     os.FileMode = 0o750
)

Variables

View Source
var ErrLogPathSymlink = errors.New("log path is a symlink")

Functions

func EnsureLogDirPerm

func EnsureLogDirPerm(path string) error

func EnsureLogFilePerm

func EnsureLogFilePerm(path string) error

func MoveAndPrune

func MoveAndPrune(logPath string, maxBackups, maxAgeDays int) error

Types

type AwareWriter

type AwareWriter struct {
	Inner    io.Writer
	Archiver *CompressedLogArchiver
}

func (*AwareWriter) Write

func (w *AwareWriter) Write(p []byte) (int, error)

type CompressedLogArchiver

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

func NewCompressedLogArchiver

func NewCompressedLogArchiver(logPath string, maxBackups, maxAgeDays int, enabled bool) *CompressedLogArchiver

func (*CompressedLogArchiver) Close

func (a *CompressedLogArchiver) Close() error

func (*CompressedLogArchiver) Trigger

func (a *CompressedLogArchiver) Trigger()

Jump to

Keyboard shortcuts

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