format

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DirUserGroupRead is for directories that should be readable by owner and group (rwxr-x---)
	DirUserGroupRead fs.FileMode = 0750

	// FilePublicRead is for files that should be world-readable (rw-r--r--)
	// Used for documentation, assets, and other public files
	FilePublicRead fs.FileMode = 0644

	// FileUserReadWrite is for files that should only be readable by owner (rw-------)
	// Used for sensitive files like logs, secrets, and configuration
	FileUserReadWrite fs.FileMode = 0600
)

Common file permission constants used throughout the application. These constants provide named values for file and directory permissions instead of using magic numbers.

Variables

This section is empty.

Functions

func CalculateZipFileSize

func CalculateZipFileSize(data []byte) uint64

CalculateZipFileSize returns the aggregated uncompressed size of files inside a zip archive

func ContainsI

func ContainsI(a string, b string) bool

func ExtractHTMLTitleFromB64Html

func ExtractHTMLTitleFromB64Html(body []byte) string

func GetPlatformAgnosticNewline

func GetPlatformAgnosticNewline() string

func IsDirectory

func IsDirectory(path string) bool

func ParseHumanSize

func ParseHumanSize(size string) (int64, error)

ParseHumanSize parses a human-readable size string (e.g., "500Mb", "2Gb") into bytes

func ParseISO8601

func ParseISO8601(dateStr string) time.Time

func PrettyPrintYAML

func PrettyPrintYAML(yamlStr string) (string, error)

func RandomStringN

func RandomStringN(n int) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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