Documentation
¶
Overview ¶
Helpers for working with files and filesystems
Index ¶
- Variables
- func AddMimeTypeFile(filename string)
- func GetMimeType(filenameOrReader interface{}, fallback ...string) string
- func InitMime()
- func IsTerminal() bool
- func MustReadAll(filename string) []byte
- func MustReadAllString(filename string) string
- func ReadAll(filename string) ([]byte, error)
- func ReadAllLines(filename string) ([]string, error)
- func ReadAllString(filename string) (string, error)
- func ReadFirstLine(filename string) (string, error)
- type RewriteFileSystem
Constants ¶
This section is empty.
Variables ¶
View Source
var DirExists = pathutil.DirExists
Alias functions from pathutil as a convenience
View Source
var Exists = pathutil.Exists
View Source
var ExpandUser = pathutil.ExpandUser
View Source
var FileExists = pathutil.FileExists
View Source
var IsAppend = pathutil.IsAppend
View Source
var IsAppendable = pathutil.IsAppendable
View Source
var IsCharDevice = pathutil.IsCharDevice
View Source
var IsDevice = pathutil.IsDevice
View Source
var IsExclusive = pathutil.IsExclusive
View Source
var IsNamedPipe = pathutil.IsNamedPipe
View Source
var IsNonemptyDir = pathutil.IsNonemptyDir
View Source
var IsNonemptyExecutableFile = pathutil.IsNonemptyExecutableFile
View Source
var IsNonemptyFile = pathutil.IsNonemptyFile
View Source
var IsReadable = pathutil.IsReadable
View Source
var IsSetgid = pathutil.IsSetgid
View Source
var IsSetuid = pathutil.IsSetuid
View Source
var IsSocket = pathutil.IsSocket
View Source
var IsSticky = pathutil.IsSticky
View Source
var IsSymlink = pathutil.IsSymlink
View Source
var IsTemporary = pathutil.IsTemporary
View Source
var IsWritable = pathutil.IsWritable
View Source
var LinkExists = pathutil.LinkExists
Functions ¶
func AddMimeTypeFile ¶ added in v1.6.14
func AddMimeTypeFile(filename string)
func GetMimeType ¶ added in v1.6.14
GetMimeType goes out of its way to really, really try to figure out the MIME type of a given filename or io.Reader. If the first argument satisfies the io.Seeker interface, the seeker will Seek() back to the beginning. If it satisfies the io.Closer interface, it will be closed.
func IsTerminal ¶
func IsTerminal() bool
func MustReadAll ¶
func MustReadAllString ¶
func ReadAllLines ¶ added in v1.6.13
func ReadAllString ¶
func ReadFirstLine ¶ added in v1.6.13
Types ¶
type RewriteFileSystem ¶
Click to show internal directories.
Click to hide internal directories.