sorter

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const MimeTypeName = filter.MimeTypeName
View Source
const RecursiveSizeName = content.RecursiveSizeName

Variables

This section is empty.

Functions

func ByExtensionAscend

func ByExtensionAscend(a, b *item.FileInfo) int

func ByExtensionCaseSensitiveAscend

func ByExtensionCaseSensitiveAscend(a, b *item.FileInfo) int

func ByExtensionCaseSensitiveDescend

func ByExtensionCaseSensitiveDescend(a, b *item.FileInfo) int

func ByExtensionDescend

func ByExtensionDescend(a, b *item.FileInfo) int

func ByGroupAscend

func ByGroupAscend(a, b *item.FileInfo) int

func ByGroupCaseSensitiveAscend

func ByGroupCaseSensitiveAscend(a, b *item.FileInfo) int

func ByGroupCaseSensitiveDescend

func ByGroupCaseSensitiveDescend(a, b *item.FileInfo) int

func ByGroupDescend

func ByGroupDescend(a, b *item.FileInfo) int

func ByInodeAscend

func ByInodeAscend(a, b *item.FileInfo) int

func ByInodeDescend

func ByInodeDescend(a, b *item.FileInfo) int

func ByMimeTypeAscend

func ByMimeTypeAscend(a, b *item.FileInfo) int

func ByMimeTypeDescend

func ByMimeTypeDescend(a, b *item.FileInfo) int

func ByMimeTypeParentAscend

func ByMimeTypeParentAscend(a, b *item.FileInfo) int

func ByMimeTypeParentDescend

func ByMimeTypeParentDescend(a, b *item.FileInfo) int

func ByNameAscend

func ByNameAscend(a, b *item.FileInfo) int

func ByNameCaseSensitiveAscend

func ByNameCaseSensitiveAscend(a, b *item.FileInfo) int

func ByNameCaseSensitiveDescend

func ByNameCaseSensitiveDescend(a, b *item.FileInfo) int

func ByNameDescend

func ByNameDescend(a, b *item.FileInfo) int

func ByNameWidthAscend

func ByNameWidthAscend(a, b *item.FileInfo) int

func ByNameWidthDescend

func ByNameWidthDescend(a, b *item.FileInfo) int

func ByNameWithoutALeadingDotAscend

func ByNameWithoutALeadingDotAscend(a, b *item.FileInfo) int

func ByNameWithoutALeadingDotCaseSensitiveAscend

func ByNameWithoutALeadingDotCaseSensitiveAscend(a, b *item.FileInfo) int

func ByNameWithoutALeadingDotCaseSensitiveDescend

func ByNameWithoutALeadingDotCaseSensitiveDescend(a, b *item.FileInfo) int

func ByNameWithoutALeadingDotDescend

func ByNameWithoutALeadingDotDescend(a, b *item.FileInfo) int

func ByNone

func ByNone(a, b *item.FileInfo) int

ByNone Deprecated

func ByOwnerAscend

func ByOwnerAscend(a, b *item.FileInfo) int

func ByOwnerCaseSensitiveAscend

func ByOwnerCaseSensitiveAscend(a, b *item.FileInfo) int

func ByOwnerCaseSensitiveDescend

func ByOwnerCaseSensitiveDescend(a, b *item.FileInfo) int

func ByOwnerDescend

func ByOwnerDescend(a, b *item.FileInfo) int

func BySizeAscend

func BySizeAscend(a, b *item.FileInfo) int

func BySizeDescend

func BySizeDescend(a, b *item.FileInfo) int

func ByVersionAscend

func ByVersionAscend(a, b *item.FileInfo) int

func ByVersionDescend

func ByVersionDescend(a, b *item.FileInfo) int

func Default

func Default(a, b *item.FileInfo) int

Types

type FileSortFunc

type FileSortFunc = func(a, b *item.FileInfo) int

func ByRecursiveSizeAscend

func ByRecursiveSizeAscend(depth int) FileSortFunc

func ByRecursiveSizeDescend

func ByRecursiveSizeDescend(depth int) FileSortFunc

func ByTimeAscend

func ByTimeAscend(timeType string) FileSortFunc

func ByTimeDescend

func ByTimeDescend(timeType string) FileSortFunc

type Option

type Option = func(s *Sorter)

func WithSize

func WithSize(size int) Option

func WithSortOption

func WithSortOption(option ...FileSortFunc) Option

type Sorter

type Sorter struct {
	// contains filtered or unexported fields
}

func NewSorter

func NewSorter(option ...Option) *Sorter

func (*Sorter) AddOption

func (s *Sorter) AddOption(option ...FileSortFunc)

func (*Sorter) Build

func (s *Sorter) Build() FileSortFunc

func (*Sorter) DirFirst

func (s *Sorter) DirFirst()

func (*Sorter) Len

func (s *Sorter) Len() int

func (*Sorter) Reset

func (s *Sorter) Reset()

func (*Sorter) Reverse

func (s *Sorter) Reverse()

func (*Sorter) UnsetDirFirst

func (s *Sorter) UnsetDirFirst()

Jump to

Keyboard shortcuts

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