types

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: EUPL-1.2 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// "const" string slice to enforce the field order for pretty printing
	FTypeNames  = func() []string { return []string{"dir", "audio", "application", "image", "other", "total"} }
	FClassNames = func() []string {
		return []string{"dir", "other", "application", "archive", "audio", "document", "image", "video"}
	}
)

Functions

func FileTypeStatsToString

func FileTypeStatsToString(self *FileTypeStats)

Types

type FTypeStat

type FTypeStat struct {
	Path      string
	FType     string
	NumBytes  uint64
	FileCount uint
}

FTypeStat contains:

either a summary for one filetype (Path is wildcard and FileCount >= 1)
or the type and size of one file (Path is regular file and FileCount == 1)

type FTypeStatsBatch added in v0.8.0

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

FTypeStatsBatch is a "stack like" buffer with a pointer to the next free slot

func NewFTypeStatsBatch added in v0.8.0

func NewFTypeStatsBatch(capacity int) *FTypeStatsBatch

func (*FTypeStatsBatch) AllElem added in v0.8.0

func (fb *FTypeStatsBatch) AllElem() []FTypeStat

func (*FTypeStatsBatch) IsEmpty added in v0.8.0

func (fb *FTypeStatsBatch) IsEmpty() bool

func (*FTypeStatsBatch) IsFull added in v0.8.0

func (fb *FTypeStatsBatch) IsFull() bool

func (*FTypeStatsBatch) Push added in v0.8.0

func (fb *FTypeStatsBatch) Push(elem FTypeStat) bool

Push pushes an item in the buffer and returns false if the buffer is full (For convenience false will still handle the current pushif possible, it's just the last one possible, so flushing should be handled by the user)

func (*FTypeStatsBatch) Reset added in v0.8.0

func (fb *FTypeStatsBatch) Reset()

type FileTypeStats

type FileTypeStats map[string]*FTypeStat

FileTypeStats is a map from type (same as FTypeStat.FType) to FTypeStat

func (*FileTypeStats) ToString

func (f *FileTypeStats) ToString() string

Jump to

Keyboard shortcuts

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