utils

package
v0.0.0-...-68bef91 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KiB = 1 << (10 * (iota + 1)) // Kibibytes
	MiB = 1 << (10 * (iota + 1)) // Mibibytes
	GiB = 1 << (10 * (iota + 1)) // Gibibytes
	TiB = 1 << (10 * (iota + 1)) // Tebibytes
	PiB = 1 << (10 * (iota + 1)) // Pebibytes
	EiB = 1 << (10 * (iota + 1)) // Exbibytes
)

Variables

This section is empty.

Functions

func GetSize

func GetSize(value int64) string

func IsDirExists

func IsDirExists(dirname string) bool

IsDirExists checks the directory availability

func IsValidPath

func IsValidPath(baseDir, filename string) (string, bool)

Types

type File

type File struct {
	Name         string
	Size         int64
	FriendlySize string
	ModifiedTime time.Time
	IsDir        bool
	FullPath     string
	Ext          string
}

File struct

func IsFileExists

func IsFileExists(filename string) *File

IsFileExists checks the file availability

func ListFiles

func ListFiles(baseDir, dir string) ([]File, error)

ListFiles func

Jump to

Keyboard shortcuts

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