sort

package
v0.0.0-...-be89b69 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirEntrySorter

type DirEntrySorter interface {
	Sort([]fs.DirEntry) []fs.DirEntry
}

func NewDirEntrySorter

func NewDirEntrySorter(field Field, order Order) (DirEntrySorter, error)

type Field

type Field string
var (
	Name       Field = "name"
	ModifiedAt Field = "modifiedAt"
)

func ToField

func ToField(field string) (Field, error)

type ModifiedAtDirEntrySorter

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

func NewModifiedAtDirEntrySorter

func NewModifiedAtDirEntrySorter(order Order) (*ModifiedAtDirEntrySorter, error)

func (*ModifiedAtDirEntrySorter) Sort

func (m *ModifiedAtDirEntrySorter) Sort(entries []fs.DirEntry) []fs.DirEntry

type NameDirEntrySorter

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

func NewNameDirEntrySorter

func NewNameDirEntrySorter(order Order) (*NameDirEntrySorter, error)

func (*NameDirEntrySorter) Sort

func (n *NameDirEntrySorter) Sort(entries []fs.DirEntry) []fs.DirEntry

type Order

type Order string
const ASC Order = "ASC"
const DESC Order = "DESC"

func ToOrder

func ToOrder(field string) (Order, error)

Jump to

Keyboard shortcuts

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