format

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearCache

func ClearCache()

Discards the entire git status cache.

func ComputeGitRepo

func ComputeGitRepo(startPath string) (map[string]string, string, error)

ComputeGitRepo ensures we have the git status map cached for the repository containing startPath. Returns a map of [absolute path -> status code] for all files in the repo, including directories, together with the repo root path and an error if not in a git repo or if 'git' fails.

func GetFilesGitStatus

func GetFilesGitStatus(p string) map[string]string

Returns a map of "relative path -> single-letter code" specifically under directory p adding the directory markers for each subdirectory.

func GetFormattedSize

func GetFormattedSize(b int64, humanReadable bool) string

func GetHardLinkCount

func GetHardLinkCount(absPath string) uint64

func GetIcon

func GetIcon(name, ext, indicator string) *icons.IconInfo

func GetIndicator

func GetIndicator(name string, isLongMode bool) (i string)

get indicator of the file

func GetInodeNumber

func GetInodeNumber(path string) string

func GetModeExtended

func GetModeExtended(fi *os.FileInfo, fullPath string) string

func GetOpenDirIcon

func GetOpenDirIcon() *icons.IconInfo

func GetSymlinkIndicator

func GetSymlinkIndicator(name string, isLongMode bool) string
func IsLink(name string) bool

func MainSort

func MainSort(a, b string) bool

func SetLessFunction

func SetLessFunction(d *model.Directory, sortMode model.SortMode)

Custom less functions

Types

type DefaultFormatter

type DefaultFormatter struct{}

func (*DefaultFormatter) Format

func (*DefaultFormatter) Format(t *time.Time) string

type ExtendedFormatter

type ExtendedFormatter struct{}

func (*ExtendedFormatter) Format

func (*ExtendedFormatter) Format(t *time.Time) string

type Timestamp

type Timestamp interface {
	Format(t *time.Time) string
}

func GetFormatter

func GetFormatter(extended bool) Timestamp

Jump to

Keyboard shortcuts

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