Documentation
¶
Overview ¶
Package filter provide data filter, sanitize, convert
Index ¶
- Variables
- func Bool(s string) (bool, error)
- func CamelCase(str string, sep ...string) string
- func Email(s string) string
- func Float(str string) (float64, error)
- func GetByPath(key string, mp map[string]interface{}) (val interface{}, ok bool)
- func Int(in interface{}) (int, error)
- func Int64(in interface{}) (int64, error)
- func LowerFirst(s string) string
- func MustBool(s string) bool
- func MustFloat(str string) float64
- func MustInt(in interface{}) int
- func MustInt64(in interface{}) int64
- func MustUint(in interface{}) uint64
- func SnakeCase(str string, sep ...string) string
- func StrToArray(str string, sep ...string) []string
- func StrToSlice(str string, sep ...string) []string
- func StrToTime(s string, layouts ...string) (t time.Time, err error)
- func Substr(s string, pos, length int) string
- func ToBool(s string) (bool, error)
- func ToFloat(str string) (float64, error)
- func ToInt(in interface{}) (iVal int, err error)
- func ToInt64(in interface{}) (i64 int64, err error)
- func ToUint(in interface{}) (u64 uint64, err error)
- func Trim(str string, cutSet ...string) string
- func TrimLeft(s string, cutSet ...string) string
- func TrimRight(s string, cutSet ...string) string
- func Uint(in interface{}) (uint64, error)
- func Unique(val interface{}) interface{}
- func UpperFirst(s string) string
- func UrlDecode(s string) string
- func UrlEncode(s string) string
- type Filtration
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Lower = strings.ToLower Upper = strings.ToUpper Title = strings.ToTitle // escape string. EscapeJS = template.JSEscapeString EscapeHTML = template.HTMLEscapeString )
some alias methods.
Functions ¶
func CamelCase ¶ added in v1.0.1
CamelCase convert. Support:
"range_price" -> "rangePrice" "range price" -> "rangePrice" "range-price" -> "rangePrice"
func StrToArray ¶ added in v1.0.1
StrToArray alias of the StrToSlice()
func StrToSlice ¶ added in v1.0.2
StrToSlice split string to array.
Types ¶
type Filtration ¶
type Filtration struct {
// contains filtered or unexported fields
}
Filtration definition. Sanitization Sanitizing Sanitize
Click to show internal directories.
Click to hide internal directories.