files

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RootDir   = "."
	ParentDir = ".."
)

Variables

This section is empty.

Functions

func Compare added in v1.3.0

func Compare(x, y File) int

func FormatSize added in v1.3.0

func FormatSize(size int64) string

func Sort added in v1.3.0

func Sort(files []File)

Types

type Controller added in v1.5.0

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

func NewController added in v1.5.0

func NewController(fs fs.FS, exclude *regexp.Regexp) *Controller

func (*Controller) FilesHTML added in v1.5.3

func (c *Controller) FilesHTML() http.Handler

func (*Controller) FilesJSON added in v1.5.3

func (c *Controller) FilesJSON() http.Handler

func (*Controller) FilesText added in v1.5.3

func (c *Controller) FilesText() http.Handler

func (*Controller) Health added in v1.5.3

func (c *Controller) Health() http.Handler

func (*Controller) IsAllowed added in v1.5.0

func (c *Controller) IsAllowed(file string) bool

type File added in v1.3.0

type File struct {
	Path  string `json:"path,omitempty"`
	Name  string `json:"name,omitempty"`
	Size  string `json:"size,omitempty"`
	IsDir bool   `json:"is_dir"`
}

type SizeUnit added in v1.3.0

type SizeUnit uint64
const (
	TeraByte SizeUnit = factor * GigaByte
	GigaByte SizeUnit = factor * MegaByte
	MegaByte SizeUnit = factor * KiloByte
	KiloByte SizeUnit = factor * Byte
	Byte     SizeUnit = 1
)

func (SizeUnit) String added in v1.3.0

func (u SizeUnit) String() string

Jump to

Keyboard shortcuts

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