fileutil

package
v40.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateSHA256

func CalculateSHA256(file string) (hash string, err error)

func Copy

func Copy(dst, src string) (nBytes int64, err error)

func SecureFiles

func SecureFiles(filepaths ...string) (err error)

SecureFiles makes the current user/group the owner of all files in filepaths, with 0600 file permissions.

func Unzip

func Unzip(b []byte, dest string) error

This is a modified version of http://stackoverflow.com/questions/20357223/easy-way-to-unzip-file-with-golang to work with in memory zip, rather than a file

func WriteToFileAsJSON

func WriteToFileAsJSON(obj interface{}, filename string) error

Types

type File

type File struct {
	Description string `json:"description"`
	Path        string `json:"path"`
	Content     string `json:"content"`
	Encoding    string `json:"encoding"`
	Format      string `json:"format"`
}

func (File) Extract

func (f File) Extract() error

func (File) ExtractFile

func (f File) ExtractFile() error

func (File) ExtractZip

func (f File) ExtractZip() error

Jump to

Keyboard shortcuts

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