fileutil

package
v1.6.20 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2018 License: MIT Imports: 13 Imported by: 28

Documentation

Overview

Helpers for working with files and filesystems

Index

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

func GetMimeType(filenameOrReader interface{}, fallback ...string) string

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 InitMime added in v1.6.14

func InitMime()

func IsTerminal

func IsTerminal() bool

func MustReadAll

func MustReadAll(filename string) []byte

func MustReadAllString

func MustReadAllString(filename string) string

func ReadAll

func ReadAll(filename string) ([]byte, error)

func ReadAllLines added in v1.6.13

func ReadAllLines(filename string) ([]string, error)

func ReadAllString

func ReadAllString(filename string) (string, error)

func ReadFirstLine added in v1.6.13

func ReadFirstLine(filename string) (string, error)

Types

type RewriteFileSystem

type RewriteFileSystem struct {
	FileSystem http.FileSystem
	Find       *regexp.Regexp
	Replace    string
	MustMatch  bool
}

func (RewriteFileSystem) Open

func (self RewriteFileSystem) Open(name string) (http.File, error)

Jump to

Keyboard shortcuts

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