Documentation
¶
Index ¶
- func Contains(haystack []string, needle string) bool
- func FormatThumbnailURL(baseURL string, r *http.Request, urlString string) string
- func HasBits(sum int32, bit int32) bool
- func IsDomain(url *url.URL, domain string) bool
- func IsDomains(url *url.URL, domains map[string]struct{}) bool
- func IsSubdomainOf(url *url.URL, parent string) bool
- func MarshalNoDur(i interface{}) ([]byte, time.Duration, error)
- func SetFromSlice(slice []interface{}) map[interface{}]struct{}
- func StringPtr(s string) *string
- func TruncateString(s string, maxLength int) string
- func UnescapeURLArgument(r *http.Request, key string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
Contains returns true if the given string array (haystack) contains given string (needle)
func FormatThumbnailURL ¶
func HasBits ¶ added in v1.2.1
HasBits checks if sum contains bit by performing a bitwise AND operation between values
func IsDomain ¶
IsDomain checks whether `url`s domain matches the given domain exactly (non-case sensitive) The `domain` string must be fully lowercased
func IsDomains ¶
IsDomains checks whether `url`s domain matches any of the given domains exactly (non-case sensitive) The `domains` map should only contain fully lowercased domains
func IsSubdomainOf ¶
IsSubdomainOf checks whether `url` is a subdomain of `parent`
func SetFromSlice ¶ added in v1.2.2
func SetFromSlice(slice []interface{}) map[interface{}]struct{}
SetFromSlice takes a slice and returns a set (represented as a map of struct{}s)
func TruncateString ¶
TruncateString truncates string down to the maximum length with a unicode triple dot if truncation took place
Types ¶
This section is empty.