model

package
v0.0.0-...-43eb642 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TotalSize

func TotalSize(files Files) (size int64)

TotalSize sums the sizes of a given set of File structs

Types

type File

type File struct {
	FullPath string
	Size     int64
	IsDir    bool
}

File contains basic information about a file or a directory, storing the values, rather than exposing them through methods as os.FileInfo does

func NewFile

func NewFile(path string, info os.FileInfo) (file *File)

NewFile creates a pointer to a File struct from an os.FileInfo

func (*File) String

func (file *File) String() string

type Files

type Files []*File

Files is a slice of File pointers

func (Files) GetFile

func (files Files) GetFile(fullPath string) (file *File)

GetFile finds a particular *File in a slice of Files and returns it

type Options

type Options struct {
	Sweeps           int
	Debug            bool
	Files            []string
	ProcessFile      func(file *File) (err error)
	ProcessDirectory func(file *File) (err error)
}

Options allows command line arguments and processing configuration to be passed around the application

func NewOptions

func NewOptions(fs afero.Fs, sweeps int, debug bool) (opts *Options)

NewOptions spins up a pointer to an Options struct with some overridable parameters

Jump to

Keyboard shortcuts

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