pathutils

package module
v0.0.0-...-dd9082c Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: MIT Imports: 7 Imported by: 2

README

go-pathutils

Go path utils.

GoDoc

Install

go get github.com/koofr/go-pathutils

Testing

go get -t
go test

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MimeMap = map[string]string{}/* 190 elements not displayed */

derived from Python's mimetypes library and nginx mime types https://github.com/koofr/mimemap/blob/master/src/main/scala/net/koofr/Mimemap.scala

Functions

func ContentType

func ContentType(path string) string

func EscapePath

func EscapePath(path string) string

func IsNameValid

func IsNameValid(name string) bool

func IsPathValid

func IsPathValid(path string) bool

func JoinNameExt

func JoinNameExt(name, ext string) (fileName string)

func NormalizeName

func NormalizeName(name string) string

func NormalizePath

func NormalizePath(path string) (newPath string, ok bool)

func SplitNameExt

func SplitNameExt(fileName string) (name, ext string)

func UnusedFilename

func UnusedFilename(exists func(string) bool, path string, maxRetries int) (newPath string, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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