filesystem

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 15 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectContentTypeOfFile

func DetectContentTypeOfFile(path string) (contenttype string, err error)

func GetAbsolutePath

func GetAbsolutePath(file string) (absolutePath string, err error)

func GetDirectories

func GetDirectories(directory string) (directories []string, err error)

func LoadFromJSON

func LoadFromJSON(reader io.Reader, v interface{}) (err error)

func LoadFromYAML

func LoadFromYAML(reader io.Reader, v interface{}) (err error)

func LoadFromYAMLFile

func LoadFromYAMLFile(path string, v interface{}) (err error)

func SaveToYAMLFile

func SaveToYAMLFile(path string, v interface{}) (err error)

func SearchFileByName

func SearchFileByName(directory string, file string, depth int) (absolutePath string, err error)

func SearchFileByNameLazy

func SearchFileByNameLazy(file string, directory string) (filepaths []string, err error)

func WriteToFile

func WriteToFile(source io.Reader, path string, mkdir bool) (err error)

func ZipExtractedSize

func ZipExtractedSize(path string) (size uint64)

Types

type Unzip

type Unzip struct {
	Destination string

	Done chan struct{}

	Err error
	// contains filtered or unexported fields
}

func NewUnzip

func NewUnzip(filename string, destination string) (unzip *Unzip)

func (*Unzip) BytesPerSecond

func (unzip *Unzip) BytesPerSecond() (speed float64)

func (*Unzip) Duration

func (unzip *Unzip) Duration() (duration time.Duration)

func (*Unzip) EndTime

func (unzip *Unzip) EndTime() (time time.Time)

func (*Unzip) Filename

func (unzip *Unzip) Filename() (filename string)

func (*Unzip) Filesize

func (unzip *Unzip) Filesize() (size uint64)

func (*Unzip) IsComplete

func (unzip *Unzip) IsComplete() bool

func (*Unzip) Progress

func (unzip *Unzip) Progress() (progress float64)

func (*Unzip) StartTime

func (unzip *Unzip) StartTime() (time time.Time)

func (*Unzip) StartUnzip

func (unzip *Unzip) StartUnzip(ctx context.Context)

func (*Unzip) Subscribe

func (unzip *Unzip) Subscribe(subscriber chan struct{})

func (*Unzip) Unsubscribe

func (unzip *Unzip) Unsubscribe(subscriber chan struct{})

func (*Unzip) Unzip

func (unzip *Unzip) Unzip(ctx context.Context)

Jump to

Keyboard shortcuts

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