helpers

package
v0.0.0-...-fa3d426 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AlphaNumChars = []rune("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")

AlphaNumChars holds all alphanumeric runes

Functions

func AvailableFilePath

func AvailableFilePath(filePath string) string

AvailableFilePath returns filePath is available, otherwise returns a path with a random filename

func EnsureDirectory

func EnsureDirectory(dirPath string)

EnsureDirectory ensures that given directory exists

func FileBase

func FileBase(filePath string) string

FileBase returns base file name Example: /foo/bar/baz.png => baz

func HasOnePrefix

func HasOnePrefix(s string, prefixes []string) bool

HasOnePrefix returns true if string has one of given prefixes

func NormalizeToPath

func NormalizeToPath(str string) string

NormalizeToPath normalizes argument to a string that can be a file or URL path

func NormalizeToSiteID

func NormalizeToSiteID(str string) string

NormalizeToSiteID normalizes argument to a string that can be a site id

func NormalizeToUsername

func NormalizeToUsername(str string) string

NormalizeToUsername normalizes argument to a string that can be a username

func Pathify

func Pathify(s string) string

Pathify normalizes argument so that we can use it in a path

func RandomAlphaNumString

func RandomAlphaNumString(size int) string

RandomAlphaNumString generates a random alphanumeric string

func Urlify

func Urlify(str string) string

Urlify normalizes argument so that it can be a URL

func WorkingDir

func WorkingDir() string

WorkingDir returns current working directory

Types

This section is empty.

Jump to

Keyboard shortcuts

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