util

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package util contains shared helpers used by multiple internal packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile added in v0.3.1

func CopyFile(src, dst string) (retErr error)

CopyFile copies a file to destination and fsyncs output.

func MoveFile added in v0.3.1

func MoveFile(src, dst string) error

MoveFile moves a file with cross-device fallback.

func ParseOlderThan

func ParseOlderThan(input string) (time.Duration, error)

ParseOlderThan parses a user-facing duration string used by --older-than. It supports Go duration format (e.g. 12h, 90m) and day shorthand (e.g. 30d).

func ReadBoundedLine added in v0.3.2

func ReadBoundedLine(r *bufio.Reader, maxBytes int) (line []byte, truncated bool, err error)

ReadBoundedLine reads one logical line without allowing unbounded growth. If the line exceeds maxBytes, the remainder is discarded through the next newline and truncated is reported as true.

Types

This section is empty.

Jump to

Keyboard shortcuts

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