aahframe.work: aahframe.work/internal/util Index | Files

package util

import "aahframe.work/internal/util"

Index

Package Files

util.go

func AddQueryString Uses

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 Uses

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 Uses

func FirstNonEmpty(values ...string) string

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

func FuncEqual Uses

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 Uses

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 Uses

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

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

func MimeTypeByExtension Uses

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 Uses

func OnlyMIME(ct string) string

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

func SanitizeValue Uses

func SanitizeValue(value interface{}) interface{}

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

Package util imports 9 packages (graph) and is imported by 4 packages. Updated 2019-04-17. Refresh now. Tools for package owners.