Documentation ¶
Index ¶
- Constants
- func Bool(d interface{}, errs ...error) (bool, error)
- func BoolItem(arr []interface{}, i int) bool
- func Bytes(d interface{}, errs ...error) []byte
- func Float32(d interface{}, errs ...error) (float32, error)
- func Float32Item(arr []interface{}, i int) float32
- func Float64(d interface{}, errs ...error) (float64, error)
- func Float64Item(arr []interface{}, i int) float64
- func Int(d interface{}, errs ...error) (int, error)
- func Int16(d interface{}, errs ...error) (int16, error)
- func Int16Item(arr []interface{}, i int) int16
- func Int32(d interface{}, errs ...error) (int32, error)
- func Int32Item(arr []interface{}, i int) int32
- func Int64(d interface{}, errs ...error) (int64, error)
- func Int64Item(arr []interface{}, i int) int64
- func Int8(d interface{}, errs ...error) (int8, error)
- func Int8Item(arr []interface{}, i int) int8
- func IsEmpty(d interface{}, errs ...error) bool
- func JoinByNames(u interface{}, ty JoinType, sep string, names ...string) string
- func JoinByTags(u interface{}, ty JoinType, sep string, tagname string, tags ...string) (ret string)
- func JoinNamesByElements(u interface{}, ty JoinType, sep string, eles ...string) string
- func JoinTagsByElements(u interface{}, ty JoinType, sep string, tagname string, eles ...string) (ret string)
- func NameTag(u interface{}, field string) string
- func NotEmpty(d interface{}, errs ...error) bool
- func Slice(d interface{}, errs ...error) ([]interface{}, error)
- func String(d interface{}, errs ...error) string
- func StringItem(arr []interface{}, i int) string
- func Tag(u interface{}, field string, tagname string) string
- func Uint(d interface{}, errs ...error) (uint, error)
- func Uint16(d interface{}, errs ...error) (uint16, error)
- func Uint16Item(arr []interface{}, i int) uint16
- func Uint32(d interface{}, errs ...error) (uint32, error)
- func Uint32Item(arr []interface{}, i int) uint32
- func Uint64(d interface{}, errs ...error) (uint64, error)
- func Uint64Item(arr []interface{}, i int) uint64
- func Uint8(d interface{}, errs ...error) (uint8, error)
- func Uint8Item(arr []interface{}, i int) uint8
- func UintItem(arr []interface{}, i int) uint
- func ValueByName(u interface{}, tag string) (interface{}, error)
- func ValueByTag(u interface{}, tagname string, tag string) (interface{}, error)
- type Dbyte
- type Dtype
- func (p *Dtype) ArrayJson(allowNil bool) (json.RawMessage, bool)
- func (p *Dtype) Bool() (bool, error)
- func (p *Dtype) Bytes() []byte
- func (p *Dtype) DefaultBool(defaultValue bool) bool
- func (p *Dtype) DefaultBytes(defaultValue []byte) []byte
- func (p *Dtype) DefaultFloat32(defaultValue float32) float32
- func (p *Dtype) DefaultFloat64(defaultValue float64) float64
- func (p *Dtype) DefaultInt(defaultValue int) int
- func (p *Dtype) DefaultInt16(defaultValue int16) int16
- func (p *Dtype) DefaultInt32(defaultValue int32) int32
- func (p *Dtype) DefaultInt64(defaultValue int64) int64
- func (p *Dtype) DefaultInt8(defaultValue int8) int8
- func (p *Dtype) DefaultSlice(defaultValue []interface{}) []interface{}
- func (p *Dtype) DefaultString(defaultValue string) string
- func (p *Dtype) DefaultUint(defaultValue uint) uint
- func (p *Dtype) DefaultUint16(defaultValue uint16) uint16
- func (p *Dtype) DefaultUint32(defaultValue uint32) uint32
- func (p *Dtype) DefaultUint64(defaultValue uint64) uint64
- func (p *Dtype) DefaultUint8(defaultValue uint8) uint8
- func (p *Dtype) Float32() (float32, error)
- func (p *Dtype) Float32s() ([]float32, bool)
- func (p *Dtype) Float64() (float64, error)
- func (p *Dtype) Float64s() ([]float64, bool)
- func (p *Dtype) Get(keys ...interface{}) (*Dtype, error)
- func (p *Dtype) Int() (int, error)
- func (p *Dtype) Int16() (int16, error)
- func (p *Dtype) Int32() (int32, error)
- func (p *Dtype) Int64() (int64, error)
- func (p *Dtype) Int64s() ([]int64, bool)
- func (p *Dtype) Int8() (int8, error)
- func (p *Dtype) Ints() ([]int, bool)
- func (p *Dtype) IsEmpty() bool
- func (p *Dtype) IsNil() bool
- func (p *Dtype) MapJson(allowNil bool) (json.RawMessage, bool)
- func (p *Dtype) NotEmpty() bool
- func (p *Dtype) Raw() interface{}
- func (p *Dtype) Reload(v interface{})
- func (p *Dtype) Slice() ([]interface{}, error)
- func (p *Dtype) SqlNullFloat64() sql.NullFloat64
- func (p *Dtype) SqlNullInt64() sql.NullInt64
- func (p *Dtype) SqlNullString() sql.NullString
- func (p *Dtype) String() string
- func (p *Dtype) Strings() ([]string, bool)
- func (p *Dtype) Uint() (uint, error)
- func (p *Dtype) Uint16() (uint16, error)
- func (p *Dtype) Uint32() (uint32, error)
- func (p *Dtype) Uint64() (uint64, error)
- func (p *Dtype) Uint64s() ([]uint64, bool)
- func (p *Dtype) Uint8() (uint8, error)
- func (p *Dtype) Uints() ([]uint, bool)
- type JoinType
- type Map
Constants ¶
View Source
const ( JoinKeys JoinType = 1 << iota // k JoinValues // v JoinMySqlValues // "v" JoinKV //kv JoinJSON // "k":"v" JoinMySQL // `t`.`k`="v" JoinMySqlFullLike // `t`.`k` LIKE "%v%" JoinMySqlStartWith // `t`.`k` LIKE "v%" JoinMySqlEndWith // `t`.`k` LIKE "%v" JoinMySqlLessThan // `t`.`k` < "v" JoinMySqlGreaterThan // `t`.`k` > "v" JoinMySqlGreaterOrEqualTo // `t`.`k` >= "v" JoinMySqlLessOrEqualTo // `t`.`k` <= "v" JoinURL // k=v JoinSortedValues = JoinSortedBit | JoinValues JoinSortedMySqlValues = JoinSortedBit | JoinMySqlValues JoinSortedKV = JoinSortedBit | JoinKV JoinSortedJSON = JoinSortedBit | JoinJSON JoinSortedMySQL = JoinSortedBit | JoinMySQL JoinSortedURL = JoinSortedBit | JoinURL )
Variables ¶
This section is empty.
Functions ¶
func Float32Item ¶
func Float64Item ¶
func JoinByTags ¶
func JoinByTags(u interface{}, ty JoinType, sep string, tagname string, tags ...string) (ret string)
JoinByTags(stru, JoinUnsortedBit, " AND ", "json", "name", "age")
func JoinNamesByElements ¶
func JoinTagsByElements ¶
func JoinTagsByElements(u interface{}, ty JoinType, sep string, tagname string, eles ...string) (ret string)
JoinTagsByElements(stru, JoinUnsortedBit, " AND ", "json", "Name", "Age")
func NotEmpty ¶
NotEmpty check if a value is empty @warn NotEmpty(byte(0)) == false, NotEmpty(byte('0')) == true
NotEmpty(0) == false, NotEmpty(-1) == true, NotEmpty(1) == true
func String ¶
String convert into string @warn byte is a built-in alias of uint8, String('A') returns "97"; String(Dbyte('A')) returns "A"
func Tag ¶
Tag Get tag of a struct. e.g. struct { Iwi string `name:"iwi"`, Nation string `name:"nation"`} dtype.Tag(stru, "Iwi", "name")
func Uint16Item ¶
func Uint32Item ¶
func Uint64Item ¶
func ValueByName ¶
func ValueByTag ¶
ValueByTag Get value by its tag in a struct
Types ¶
type Dbyte ¶
type Dbyte byte
Dbyte String('A') will returns "97". So you have to use String(Dbyte('A')) to return "A"
type Dtype ¶
type Dtype struct {
// contains filtered or unexported fields
}
func (*Dtype) ArrayJson ¶ added in v0.0.12
func (p *Dtype) ArrayJson(allowNil bool) (json.RawMessage, bool)
func (*Dtype) DefaultBool ¶
func (*Dtype) DefaultBytes ¶
func (*Dtype) DefaultFloat32 ¶
func (*Dtype) DefaultFloat64 ¶
func (*Dtype) DefaultInt ¶
func (*Dtype) DefaultInt16 ¶
func (*Dtype) DefaultInt32 ¶
func (*Dtype) DefaultInt64 ¶
func (*Dtype) DefaultInt8 ¶
func (*Dtype) DefaultSlice ¶
func (p *Dtype) DefaultSlice(defaultValue []interface{}) []interface{}
func (*Dtype) DefaultString ¶
func (*Dtype) DefaultUint ¶
func (*Dtype) DefaultUint16 ¶
func (*Dtype) DefaultUint32 ¶
func (*Dtype) DefaultUint64 ¶
func (*Dtype) DefaultUint8 ¶
func (*Dtype) MapJson ¶ added in v0.0.12
func (p *Dtype) MapJson(allowNil bool) (json.RawMessage, bool)
func (*Dtype) SqlNullFloat64 ¶
func (p *Dtype) SqlNullFloat64() sql.NullFloat64
func (*Dtype) SqlNullInt64 ¶
func (*Dtype) SqlNullString ¶
func (p *Dtype) SqlNullString() sql.NullString
Source Files ¶
Click to show internal directories.
Click to hide internal directories.