Documentation ¶
Index ¶
- Constants
- func Batch(errs ...error) error
- type CustomFunc
- type Str
- func (self *Str) Base64RawStdDecode(customError ...string) *Str
- func (self *Str) Base64RawStdEncode() *Str
- func (self *Str) Base64RawURLDecode(customError ...string) *Str
- func (self *Str) Base64RawURLEncode() *Str
- func (self *Str) Base64StdDecode(customError ...string) *Str
- func (self *Str) Base64StdEncode() *Str
- func (self *Str) Base64URLDecode(customError ...string) *Str
- func (self *Str) Base64URLEncode() *Str
- func (self *Str) Bool() (bool, error)
- func (self *Str) Custom(f CustomFunc) *Str
- func (self *Str) DefaultBool(def bool) bool
- func (self *Str) DefaultFloat32(def float32) float32
- func (self *Str) DefaultFloat64(def float64) float64
- func (self *Str) DefaultInt(def int) int
- func (self *Str) DefaultInt16(def int16) int16
- func (self *Str) DefaultInt32(def int32) int32
- func (self *Str) DefaultInt64(def int64) int64
- func (self *Str) DefaultInt8(def int8) int8
- func (self *Str) DefaultSliceBool(sep string, def []bool) []bool
- func (self *Str) DefaultSliceFloat32(sep string, def []float32) []float32
- func (self *Str) DefaultSliceFloat64(sep string, def []float64) []float64
- func (self *Str) DefaultSliceInt(sep string, def []int) []int
- func (self *Str) DefaultSliceInt16(sep string, def []int16) []int16
- func (self *Str) DefaultSliceInt32(sep string, def []int32) []int32
- func (self *Str) DefaultSliceInt64(sep string, def []int64) []int64
- func (self *Str) DefaultSliceInt8(sep string, def []int8) []int8
- func (self *Str) DefaultSliceString(sep string, trimSpace bool, def []string) []string
- func (self *Str) DefaultSliceUint(sep string, def []uint) []uint
- func (self *Str) DefaultSliceUint16(sep string, def []uint16) []uint16
- func (self *Str) DefaultSliceUint32(sep string, def []uint32) []uint32
- func (self *Str) DefaultSliceUint64(sep string, def []uint64) []uint64
- func (self *Str) DefaultSliceUint8(sep string, def []uint8) []uint8
- func (self *Str) DefaultString(def string) string
- func (self *Str) DefaultUint(def uint) uint
- func (self *Str) DefaultUint16(def uint16) uint16
- func (self *Str) DefaultUint32(def uint32) uint32
- func (self *Str) DefaultUint64(def uint64) uint64
- func (self *Str) DefaultUint8(def uint8) uint8
- func (self *Str) DenyFloat32(f []float32, customError ...string) *Str
- func (self *Str) DenyFloat64(f []float64, customError ...string) *Str
- func (self *Str) DenyInt(i []int, customError ...string) *Str
- func (self *Str) DenyInt16(i []int16, customError ...string) *Str
- func (self *Str) DenyInt32(i []int32, customError ...string) *Str
- func (self *Str) DenyInt64(i []int64, customError ...string) *Str
- func (self *Str) DenyInt8(i []int8, customError ...string) *Str
- func (self *Str) DenyOtherSymbol(allowSymbols []rune, customError ...string) *Str
- func (self *Str) DenyStr(slice []string, customError ...string) *Str
- func (self *Str) EnumFloat32(f []float32, customError ...string) *Str
- func (self *Str) EnumFloat64(f []float64, customError ...string) *Str
- func (self *Str) EnumInt(i []int, customError ...string) *Str
- func (self *Str) EnumInt16(i []int16, customError ...string) *Str
- func (self *Str) EnumInt32(i []int32, customError ...string) *Str
- func (self *Str) EnumInt64(i []int64, customError ...string) *Str
- func (self *Str) EnumInt8(i []int8, customError ...string) *Str
- func (self *Str) EnumIntSlice(sep string, slice []int, trimSpace bool, customError ...string) *Str
- func (self *Str) EnumStr(slice []string, customError ...string) *Str
- func (self *Str) EnumStrSlice(sep string, slice []string, trimSpace bool, customError ...string) *Str
- func (self *Str) Equal(str string, customError ...string) *Str
- func (self *Str) Error() error
- func (self *Str) Float32() (float32, error)
- func (self *Str) Float64() (float64, error)
- func (self *Str) HTMLEscape() *Str
- func (self *Str) HTMLUnescape() *Str
- func (self *Str) HasLetter(customError ...string) *Str
- func (self *Str) HasLower(customError ...string) *Str
- func (self *Str) HasNumber(customError ...string) *Str
- func (self *Str) HasPrefix(sub string, customError ...string) *Str
- func (self *Str) HasStr(sub string, customError ...string) *Str
- func (self *Str) HasSuffix(sub string, customError ...string) *Str
- func (self *Str) HasSymbol(customError ...string) *Str
- func (self *Str) HasUpper(customError ...string) *Str
- func (self *Str) Int() (int, error)
- func (self *Str) Int16() (int16, error)
- func (self *Str) Int32() (int32, error)
- func (self *Str) Int64() (int64, error)
- func (self *Str) Int8() (int8, error)
- func (self *Str) IsBool(customError ...string) *Str
- func (self *Str) IsChinaIDNumber(customError ...string) *Str
- func (self *Str) IsChinaMobile(customError ...string) *Str
- func (self *Str) IsChinaTel(customError ...string) *Str
- func (self *Str) IsChinese(customError ...string) *Str
- func (self *Str) IsIP(customError ...string) *Str
- func (self *Str) IsJSON(customError ...string) *Str
- func (self *Str) IsLetter(customError ...string) *Str
- func (self *Str) IsLetterOrNumber(customError ...string) *Str
- func (self *Str) IsLower(customError ...string) *Str
- func (self *Str) IsLowerOrNumber(customError ...string) *Str
- func (self *Str) IsMAC(customError ...string) *Str
- func (self *Str) IsMail(customError ...string) *Str
- func (self *Str) IsRequire() bool
- func (self *Str) IsSQLObject(customError ...string) *Str
- func (self *Str) IsSQLObjects(sep string, customError ...string) *Str
- func (self *Str) IsTCPAddr(customError ...string) *Str
- func (self *Str) IsURL(customError ...string) *Str
- func (self *Str) IsUUID(customError ...string) *Str
- func (self *Str) IsUnsigned(customError ...string) *Str
- func (self *Str) IsUpper(customError ...string) *Str
- func (self *Str) IsUpperOrNumber(customError ...string) *Str
- func (self *Str) JoinByte(values ...byte) *Str
- func (self *Str) JoinBytes(values ...[]byte) *Str
- func (self *Str) JoinRune(values ...rune) *Str
- func (self *Str) JoinStr(values ...string) *Str
- func (self *Str) MatchLength(value int, customError ...string) *Str
- func (self *Str) MaxFloat(max float64, customError ...string) *Str
- func (self *Str) MaxInteger(max int64, customError ...string) *Str
- func (self *Str) MaxLength(max int, customError ...string) *Str
- func (self *Str) MaxUTF8Length(max int, customError ...string) *Str
- func (self *Str) MinFloat(min float64, customError ...string) *Str
- func (self *Str) MinInteger(min int64, customError ...string) *Str
- func (self *Str) MinLength(min int, customError ...string) *Str
- func (self *Str) MinUTF8Length(min int, customError ...string) *Str
- func (self *Str) RemoveSpace() *Str
- func (self *Str) Require(customError ...string) *Str
- func (self *Str) Set(target interface{}, customError ...string) error
- func (self *Str) SetSlice(target interface{}, sep string, trimSpace bool, customError ...string) error
- func (self *Str) SliceBool(sep string) (result []bool, err error)
- func (self *Str) SliceFloat32(sep string) (result []float32, err error)
- func (self *Str) SliceFloat64(sep string) (result []float64, err error)
- func (self *Str) SliceInt(sep string) (result []int, err error)
- func (self *Str) SliceInt16(sep string) (result []int16, err error)
- func (self *Str) SliceInt32(sep string) (result []int32, err error)
- func (self *Str) SliceInt64(sep string) (result []int64, err error)
- func (self *Str) SliceInt8(sep string) (result []int8, err error)
- func (self *Str) SliceString(sep string, trimSpace bool) ([]string, error)
- func (self *Str) SliceUint(sep string) (result []uint, err error)
- func (self *Str) SliceUint16(sep string) (result []uint16, err error)
- func (self *Str) SliceUint32(sep string) (result []uint32, err error)
- func (self *Str) SliceUint64(sep string) (result []uint64, err error)
- func (self *Str) SliceUint8(sep string) (result []uint8, err error)
- func (self *Str) String() (string, error)
- func (self *Str) ToLower() *Str
- func (self *Str) ToUpper() *Str
- func (self *Str) Trim(sub string) *Str
- func (self *Str) TrimLeft(sub string) *Str
- func (self *Str) TrimPrefix(sub string) *Str
- func (self *Str) TrimRight(sub string) *Str
- func (self *Str) TrimSpace() *Str
- func (self *Str) TrimSuffix(sub string) *Str
- func (self *Str) URLPathEscape() *Str
- func (self *Str) URLPathUnescape(customError ...string) *Str
- func (self *Str) URLQueryEscape() *Str
- func (self *Str) URLQueryUnescape(customError ...string) *Str
- func (self *Str) Uint() (uint, error)
- func (self *Str) Uint16() (uint16, error)
- func (self *Str) Uint32() (uint32, error)
- func (self *Str) Uint64() (uint64, error)
- func (self *Str) Uint8() (uint8, error)
- func (self *Str) Value() string
Constants ¶
const InvalidErrorText = "invalid data"
InvalidErrorText 无效数据错误提示
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CustomFunc ¶ added in v2.4.1
CustomFunc 自定义处理函数 用*Str.Value()获得当前参数值 用*Str.Error()获得当前错误信息 出参是处理后的参数值和错误信息
type Str ¶
type Str struct {
// contains filtered or unexported fields
}
Str 输入字符串类型
func (*Str) Base64RawStdDecode ¶
base64 RawStd解码
func (*Str) Base64RawURLDecode ¶
base64 RawURL解码
func (*Str) Base64StdDecode ¶
base64 std解码
func (*Str) Base64URLDecode ¶
base64 URL解码
func (*Str) DefaultBool ¶
DefaultBool 转为bool类型,如果出错则只返回默认值
func (*Str) DefaultFloat32 ¶
DefaultFloat32 转为float32类型,如果出错则只返回默认值
func (*Str) DefaultFloat64 ¶
DefaultFloat64 转为float64类型,如果出错则只返回默认值
func (*Str) DefaultInt16 ¶
DefaultInt16 转为int16类型,如果出错则只返回默认值
func (*Str) DefaultInt32 ¶
DefaultInt32 转为int32类型,如果出错则只返回默认值
func (*Str) DefaultInt64 ¶
DefaultInt64 转为int64类型,如果出错则只返回默认值
func (*Str) DefaultInt8 ¶
DefaultInt8 转为int8类型,如果出错则只返回默认值
func (*Str) DefaultSliceBool ¶
DefaultSliceBool 转为[]bool类型
func (*Str) DefaultSliceFloat32 ¶
DefaultSliceFloat32 转为[]float32类型
func (*Str) DefaultSliceFloat64 ¶
DefaultSliceFloat64 转为[]float64类型
func (*Str) DefaultSliceInt ¶
DefaultSliceInt 转为[]int类型,出错则返回传入的默认值
func (*Str) DefaultSliceInt16 ¶
DefaultSliceInt16 转为[]int16类型
func (*Str) DefaultSliceInt32 ¶
DefaultSliceInt32 转为[]int8类型
func (*Str) DefaultSliceInt64 ¶
DefaultSliceInt64 转为[]int64类型,如果出错则只返回默认值
func (*Str) DefaultSliceInt8 ¶
DefaultSliceInt8 转为[]int8类型,如果出错则只返回默认值
func (*Str) DefaultSliceString ¶
DefaultSliceString 使用SetSeparator()设置的分隔符拆分成[]string类型,如果出错则只返回默认值
func (*Str) DefaultSliceUint ¶
DefaultSliceUint 转为[]int类型,出错则返回传入的默认值
func (*Str) DefaultSliceUint16 ¶
DefaultSliceUint16 转为[]uint16类型
func (*Str) DefaultSliceUint32 ¶
DefaultSliceUint32 转为[]uint8类型
func (*Str) DefaultSliceUint64 ¶
DefaultSliceUint64 转为[]uint64类型,如果出错则只返回默认值
func (*Str) DefaultSliceUint8 ¶
DefaultSliceUint8 转为[]uint8类型,如果出错则只返回默认值
func (*Str) DefaultString ¶
DefaultString 转为string类型,如果出错则只返回默认值
func (*Str) DefaultUint ¶
DefaultUint 转为uint类型,如果出错则只返回默认值
func (*Str) DefaultUint16 ¶
DefaultUint16 转为uint16类型,如果出错则只返回默认值
func (*Str) DefaultUint32 ¶
DefaultUint32 转为uint32类型,如果出错则只返回默认值
func (*Str) DefaultUint64 ¶
DefaultUint64 转为uint64类型,如果出错则只返回默认值
func (*Str) DefaultUint8 ¶
DefaultUint8 转为uint8类型,如果出错则只返回默认值
func (*Str) DenyFloat32 ¶
DenyFloat32 阻止[]float32中的值
func (*Str) DenyFloat64 ¶
DenyFloats64 阻止[]float64中的值
func (*Str) DenyOtherSymbol ¶ added in v2.5.0
DenyOtherSymbol 阻止allowSymbols之外的符号
func (*Str) EnumFloat32 ¶
EnumFloat32 仅允许[]float32中的值
func (*Str) EnumFloat64 ¶
EnumFloat64 仅允许[]float64中的值
func (*Str) EnumIntSlice ¶ added in v2.4.0
EnumIntSlice 检查[]string中的元素,仅允许指潘秉衡[]int中的值
func (*Str) EnumStrSlice ¶ added in v2.4.0
func (self *Str) EnumStrSlice(sep string, slice []string, trimSpace bool, customError ...string) *Str
EnumStrSlice 检查[]string中的元素,仅允许指定[]string中的值
func (*Str) IsChinaIDNumber ¶
IsChinaIDNumber 中国身份证号码
func (*Str) IsChinaMobile ¶
IsChinaMobile 中国手机号码
func (*Str) IsChinaTel ¶
IsChinaTel 中国固定电话号码
func (*Str) IsLetterOrNumber ¶ added in v2.4.0
IsLetterOrNumber 字母或数字
func (*Str) IsLowerOrNumber ¶ added in v2.4.0
IsLowerOrNumber 小写字母或数字
func (*Str) IsSQLObject ¶
IsSQLObject SQL对象(库名、表名、字段名)
func (*Str) IsSQLObjects ¶
IsSQLObjects SQL对象集合(库名、表名、字段名)
func (*Str) IsUnsigned ¶ added in v2.4.0
IsUnsigned 无符号数值
func (*Str) IsUpperOrNumber ¶ added in v2.4.0
IsUpperOrNumber 大写字母或数字
func (*Str) MatchLength ¶ added in v2.5.0
MatchLength 匹配长度
func (*Str) MaxInteger ¶
MaxInteger 最大整数值
func (*Str) MaxUTF8Length ¶
MaxUTF8Length UTF8编码最大长度
func (*Str) MinInteger ¶
MinInteger 最小整数值
func (*Str) MinUTF8Length ¶
MinUTF8Length UTF8编码最小长度
func (*Str) SliceFloat32 ¶
SliceFloat32 转为[]float32类型
func (*Str) SliceFloat64 ¶
SliceFloat64 转为[]float64类型
func (*Str) SliceInt16 ¶
SliceInt16 转为[]int16类型
func (*Str) SliceInt32 ¶
SliceInt32 转为[]int32类型
func (*Str) SliceInt64 ¶
SliceInt64 转为[]int64类型
func (*Str) SliceString ¶
SliceString 使用SetSeparator()设置的分隔符拆分成[]string类型
func (*Str) SliceUint16 ¶
SliceUint16 转为[]uint16类型
func (*Str) SliceUint32 ¶
SliceUint32 转为[]uint32类型
func (*Str) SliceUint64 ¶
SliceUint64 转为[]uint64类型
func (*Str) SliceUint8 ¶
SliceUint8 转为[]int8类型
func (*Str) URLPathUnescape ¶
url.PathUnescape
func (*Str) URLQueryEscape ¶
URLQueryEscape 与url.QueryEscape相同
func (*Str) URLQueryUnescape ¶
与url.QueryUnescape相同