tool

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Byte  = 1
	KByte = Byte * 1024
	MByte = KByte * 1024
	GByte = MByte * 1024
	TByte = GByte * 1024
	PByte = TByte * 1024
	EByte = PByte * 1024
)

Variables

This section is empty.

Functions

func FileSize

func FileSize(s int64) string

FileSize calculates the file size and generate user-friendly string.

func IsImageFile

func IsImageFile(data []byte) bool

func IsKeyInArray

func IsKeyInArray(array []string, key string) bool

func IsPDFFile

func IsPDFFile(data []byte) bool

func IsReadmeFile

func IsReadmeFile(name string) bool

IsReadmeFile reports whether name looks like a README file based on its extension.

func IsTextFile

func IsTextFile(data []byte) bool

IsTextFile returns true if file content format is plain text or empty.

func IsVideoFile

func IsVideoFile(data []byte) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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