Documentation
¶
Index ¶
- Constants
- Variables
- func AtomicWriteFile(fileName string, data []byte, perm os.FileMode) error
- func DetectMimeType(path string, fileInfo fs.FileInfo, extended bool) string
- func DetectMimeTypeWithDirEnt(path string, dirEnt fs.DirEntry) string
- func FixPath(path string) (string, error)
- func IsInitScriptPath(input string) bool
- func WinSymlinkDir(path string, bits os.FileMode) bool
- type ByteRangeType
Constants ¶
const TempFileSuffix = ".tmp"
Variables ¶
var StaticMimeTypeMap = map[string]string{}/* 1261 elements not displayed */
Functions ¶
func DetectMimeType ¶
on error just returns "" does not return "application/octet-stream" as this is considered a detection failure can pass an existing fileInfo to avoid re-statting the file falls back to text/plain for 0 byte files
func IsInitScriptPath ¶
IsInitScriptPath tries to determine if the input string is a path to a script rather than an inline script content.
Types ¶
type ByteRangeType ¶
type ByteRangeType struct {
All bool
Start int64
End int64 // inclusive; only valid when OpenEnd is false
OpenEnd bool // true when range is "N-" (read from Start to EOF)
}
func ParseByteRange ¶
func ParseByteRange(rangeStr string) (ByteRangeType, error)