Documentation
¶
Index ¶
- func AddQueryString(u, k, v string) string
- func DetectFileContentType(file string, content io.ReadSeeker) (string, error)
- func FirstNonEmpty(values ...string) string
- func FuncEqual(a, b interface{}) bool
- func IsGzipWorthForFile(name string) bool
- func IsValidTimeUnit(str string, units ...string) bool
- func MimeTypeByExtension(ext string) string
- func OnlyMIME(ct string) string
- func SanitizeValue(value interface{}) interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddQueryString ¶
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 ¶
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: http://golang.org/s/go11func
func IsGzipWorthForFile ¶
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 ¶
IsValidTimeUnit method to check supported time unit suffixes. If supported returns true otherwise false.
func MimeTypeByExtension ¶
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 SanitizeValue ¶
func SanitizeValue(value interface{}) interface{}
SanitizeValue method to sanatizes type `string`, rest we can't do any. It's a user responbility.
Types ¶
This section is empty.