model

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OpenDirIcon = icons.IconDef["diropen"].GetColor() + icons.IconDef["diropen"].GetGlyph() + "\033[0m" + " "
View Source
var PathSeparator string = string(os.PathSeparator)

Functions

func DirBlocks

func DirBlocks(info *Entry, fi os.FileInfo)

func GetOwnerGroupInfo

func GetOwnerGroupInfo(fi os.FileInfo, noGroup bool, longListingMode Listing) (o string, g string)

Types

type Directory

type Directory struct {
	Info   *Entry
	Parent *Entry
	Files  []*Entry
	Dirs   []string
	LessFn func(int, int) bool
}

func (*Directory) Len

func (d *Directory) Len() int

func (*Directory) Less

func (d *Directory) Less(i, j int) bool

func (*Directory) Sort

func (d *Directory) Sort(sortMode SortMode, reverse bool)

func (*Directory) Swap

func (d *Directory) Swap(i, j int)

type DirectoryEntry

type DirectoryEntry struct {
	os.File
	AbsPath string
}

type Entry

type Entry struct {
	Name, Ext, Indicator string
	ModTime              time.Time
	Size                 int64
	Mode                 string
	ModeBits             uint32
	NumHardLinks         uint64
	Owner, Group         string
	Blocks               int64
	GitStatus            string
	Icon                 *icons.IconInfo
	InodeNumber          string
}

type ExitCode

type ExitCode int
const (
	CodeOk ExitCode = iota
	CodeMinor
	CodeSerious
)

func (*ExitCode) SetMinor

func (e *ExitCode) SetMinor()

func (*ExitCode) SetSerious

func (e *ExitCode) SetSerious()

type FileEntry

type FileEntry struct {
	os.FileInfo
	AbsPath string
}

type Include

type Include int
const (
	IncludeDefault Include = iota
	IncludeAlmost
	IncludeAll
)

type Listing

type Listing int
const (
	LongListingOwner Listing = iota
	LongListingGroup
	LongListingDefault
	LongListingNone
)

type SortMode

type SortMode int
const (
	SortSize SortMode = iota
	SortModTime
	SortExtension
	SortAlphabetical
	SortNatural
	SortNone
)

Jump to

Keyboard shortcuts

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