This section is empty.


This section is empty.


func AddQueryString

func AddQueryString(u, k, v string) string

AddQueryString method to add the given query string key value pair appropriately to the given URL string.

func DetectFileContentType

func DetectFileContentType(file string, content io.ReadSeeker) (string, error)

DetectFileContentType method to identify the static file content-type. It's similar to http.DetectContentType but has windows OS and corner case covered.

func FirstNonEmpty

func FirstNonEmpty(values ...string) string

FirstNonEmpty method returns the first non-empty string from given var args otherwise empty string.

func FuncEqual

func FuncEqual(a, b interface{}) bool

FuncEqual method to compare to function callback interface data. In effect comparing the pointers of the indirect layer. Read more about the representation of functions here:

func IsGzipWorthForFile

func IsGzipWorthForFile(name string) bool

IsGzipWorthForFile method to decide whether gzipping file content it worth to do by checking file extension. If its worth to do it returns true otherwise false.

func IsValidTimeUnit

func IsValidTimeUnit(str string, units ...string) bool

IsValidTimeUnit method to check supported time unit suffixes. If supported returns true otherwise false.

func MimeTypeByExtension

func MimeTypeByExtension(ext string) string

MimeTypeByExtension method to get MIME info by file extension with corner case covered since mime.TypeByExtension behaves wired on windows for `.js` and `.css`, it better to have some basic measure

func OnlyMIME

func OnlyMIME(ct string) string

OnlyMIME method to strip everything after `;` from the content type value.

func SanitizeValue

func SanitizeValue(value interface{}) interface{}

SanitizeValue method to sanatizes type `string`, rest we can't do any. It's a user responbility.


This section is empty.

Source Files