util

package
v1.0.0-beta Latest Latest
Warning

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

Go to latest
Published: May 2, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckExists

func CheckExists(name string, dir string) bool

Checks if the filename already exists in a directory.

NOTE: THIS IS GLOB-LIKE AND WILL CHECK IF THE DIRECTORY CONTAINS A FILE, WHICH CONTAINS THE "name" STRING. IT IS EXPLICITLY MADE TO BE USED BY THE goimage PROGRAM

func Contains

func Contains(s []string, e string) bool

Checks if a string slice contains a string

func GenerateName

func GenerateName(n int) string

Generates a name of a specified length

func GetFileExt

func GetFileExt(s string) string

Gets the file extension from the specified string

NOTE: CHECKS A VERY SPECIFIC STRING (http.Request FileForm handler.Header["Content-Disposition"][0]) AND IT IS EXPLICITLY USED TO BE USED BY THE goimage PROGRAM

func GetFileExtFromDir

func GetFileExtFromDir(name string, dir string) string

This function reads a directory, and gets the extension from the file which matches the name string (Glob code: *name*). Returns empty string on no results.

Types

This section is empty.

Jump to

Keyboard shortcuts

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