Documentation ¶
Index ¶
- Constants
- Variables
- func CopyFile(source, dest string) (bool, error)
- func DeleteIfFileExist(filename string) error
- func FileExists(path string) bool
- func FileSize(filename string) (int64, error)
- func GetFileExt(filename string) string
- func GetTempDir() string
- func Home() string
- func IsDir(path string) bool
- func IsFile(path string) bool
- func IsImageFile(path string) bool
- func JoinMulti(path string, items ...string) string
- func MimeType(path string) (mime string)
- func ParentDir(path string) (string, error)
- func PathExists(path string) bool
- func ReaderMimeType(r io.Reader) (mime string)
- func SelfDir() (path string, err error)
- func SetHome(s string) error
- type WalkFunc
Constants ¶
View Source
const (
// sniff Length, use for detect file mime type
MimeSniffLen = 512
)
Variables ¶
View Source
var Abs = filepath.Abs
View Source
var Base = filepath.Base
View Source
var Clean = filepath.Clean
View Source
var Dir = filepath.Dir
View Source
var ErrBadPattern = filepath.ErrBadPattern
View Source
var EvalSymlinks = filepath.EvalSymlinks
View Source
var Ext = filepath.Ext
View Source
var FromSlash = filepath.FromSlash
View Source
var Glob = filepath.Glob
View Source
var IsAbs = filepath.IsAbs
View Source
var Join = filepath.Join
View Source
var ListSeparator = filepath.ListSeparator
View Source
var Match = filepath.Match
View Source
var Rel = filepath.Rel
View Source
var Separator = filepath.Separator
View Source
var SkipDir = filepath.SkipDir
View Source
var Split = filepath.Split
View Source
var SplitList = filepath.SplitList
View Source
var ToSlash = filepath.ToSlash
View Source
var VolumeName = filepath.VolumeName
View Source
var Walk = filepath.Walk
Functions ¶
func FileExists ¶
FileExists reports whether the named file or directory exists.
func GetTempDir ¶
func GetTempDir() string
GetTempDir returns the default directory to use for temporary files.
func Home ¶
func Home() string
Home returns the os-specific home path as specified in the environment.
func PathExists ¶
PathExists reports whether the named file or directory exists.
func ReaderMimeType ¶
ReaderMimeType get the io.Reader mimeType Usage:
file, err := os.Open(filepath) if err != nil { return } mime := ReaderMimeType(file)
Types ¶
Click to show internal directories.
Click to hide internal directories.