embed

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package embed provides utilities for working with the embedded filesystem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatBytes

func FormatBytes(bytes int64) string

FormatBytes formats byte count as human-readable size.

func FormatMode

func FormatMode(mode fs.FileMode) string

FormatMode formats file mode similar to ls -l.

func FormatTime

func FormatTime(t time.Time) string

FormatTime formats time in a standard way.

func GetEmbeddedFS

func GetEmbeddedFS() fs.FS

GetEmbeddedFS returns the embedded filesystem.

func IsHidden

func IsHidden(name string) bool

IsHidden checks if a file is hidden (starts with .).

func NormalizePath

func NormalizePath(p string) string

NormalizePath normalizes an embedded filesystem path.

Types

type FileInfo

type FileInfo struct {
	Name    string
	Size    int64
	Mode    fs.FileMode
	ModTime time.Time
	IsDir   bool
	Path    string
}

FileInfo extracts info from fs.DirEntry and fs.FileInfo.

func GetFileInfoFromEntry

func GetFileInfoFromEntry(entry fs.DirEntry, fullPath string, _ fs.FS) (*FileInfo, error)

GetFileInfoFromEntry gets file info from a directory entry.

func GetFileInfoFromPath

func GetFileInfoFromPath(fsys fs.FS, fullPath string) (*FileInfo, error)

GetFileInfoFromPath gets file info from a path.

Jump to

Keyboard shortcuts

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