Documentation ¶
Index ¶
- Constants
- type EmptyStruct
- type NullBool
- type NullFloat64
- func (nf NullFloat64) Empty() bool
- func (nf *NullFloat64) Equal(v NullFloat64) bool
- func (nf *NullFloat64) GetValue() float64
- func (nf *NullFloat64) IsNull() bool
- func (nf NullFloat64) MarshalJSON() ([]byte, error)
- func (nf NullFloat64) String() string
- func (nf *NullFloat64) UnmarshalJSON(b []byte) error
- type NullInt
- type NullInt32
- type NullInt64
- type NullString
- type NullTime
- func (nt NullTime) Empty() bool
- func (nt *NullTime) Equal(v NullTime) bool
- func (nt *NullTime) GetValue() time.Time
- func (nt *NullTime) IsNull() bool
- func (nt NullTime) MarshalJSON() ([]byte, error)
- func (nt NullTime) String() string
- func (nt *NullTime) TimeStamp() int64
- func (nt *NullTime) UnmarshalJSON(b []byte) error
- type Pageable
- type RespOpt
- type Response
- type Result
- type ResultOpt
- type Set
- func (set *Set) Add(v interface{})
- func (set *Set) Common(s *Set) *Set
- func (set *Set) Copy() *Set
- func (set *Set) Del(v interface{})
- func (set *Set) Diff(s *Set) *Set
- func (set *Set) Float64Values() ([]float64, error)
- func (set *Set) Has(v interface{}) bool
- func (set *Set) Int32Values() ([]int32, error)
- func (set *Set) Int64Values() ([]int64, error)
- func (set *Set) IntValues() ([]int, error)
- func (set *Set) IsEmpty() bool
- func (set *Set) IsNotEmpty() bool
- func (set *Set) MustFloat64Values() []float64
- func (set *Set) MustInt32Values() []int32
- func (set *Set) MustInt64Values() []int64
- func (set *Set) MustIntValues() []int
- func (set *Set) MustStrValues() []string
- func (set *Set) NotHas(v interface{}) bool
- func (set *Set) Size() int
- func (set *Set) StrValues() ([]string, error)
- func (set *Set) String() string
- func (set *Set) Union(s *Set) *Set
- func (set *Set) Update(vs ...interface{})
- func (set *Set) UpdateFloat32s(vs ...float32)
- func (set *Set) UpdateFloat64s(vs ...float64)
- func (set *Set) UpdateInt32s(vs ...int32)
- func (set *Set) UpdateInt64s(vs ...int64)
- func (set *Set) UpdateInts(vs ...int)
- func (set *Set) UpdateStrings(vs ...string)
- func (set *Set) Values() []interface{}
Constants ¶
const ( OK = 0 SUCCESS = "success" InvalidParams = 10000 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmptyStruct ¶
type EmptyStruct struct{}
func NewEmptyStruct ¶
func NewEmptyStruct() EmptyStruct
type NullBool ¶
NullBool is an alias for sql.NullBool data type.
func NewBoolNull ¶
func NewBoolNull() NullBool
func (NullBool) MarshalJSON ¶
MarshalJSON for NullBool.
func (*NullBool) UnmarshalJSON ¶
UnmarshalJSON for NullBool.
type NullFloat64 ¶
type NullFloat64 struct {
sql.NullFloat64
}
NullFloat64 is an alias for sql.NullFloat64 data type.
func NewFloat64 ¶
func NewFloat64(v float64) NullFloat64
func NewFloat64Null ¶
func NewFloat64Null() NullFloat64
func (NullFloat64) MarshalJSON ¶
func (nf NullFloat64) MarshalJSON() ([]byte, error)
MarshalJSON for NullFloat64.
func (NullFloat64) String ¶
func (nf NullFloat64) String() string
func (*NullFloat64) UnmarshalJSON ¶
func (nf *NullFloat64) UnmarshalJSON(b []byte) error
UnmarshalJSON for NullFloat64.
type NullInt ¶
NullInt is an alias for sql.NullInt64 data type.
func NewIntNull ¶
func NewIntNull() NullInt
func (NullInt) MarshalJSON ¶
MarshalJSON for NullInt.
func (*NullInt) UnmarshalJSON ¶
UnmarshalJSON for NullInt.
type NullInt32 ¶ added in v1.4.1
NullInt32 is an alias for sql.NullInt64 data type.
func NewInt32Null ¶ added in v1.4.1
func NewInt32Null() NullInt32
func (NullInt32) MarshalJSON ¶ added in v1.4.1
MarshalJSON for NullInt.
func (*NullInt32) UnmarshalJSON ¶ added in v1.4.1
UnmarshalJSON for NullInt.
type NullInt64 ¶
NullInt64 is an alias for sql.NullInt64 data type.
func NewInt64Null ¶
func NewInt64Null() NullInt64
func (NullInt64) MarshalJSON ¶
MarshalJSON for NullInt64.
func (*NullInt64) UnmarshalJSON ¶
UnmarshalJSON for NullInt64.
type NullString ¶
type NullString struct {
sql.NullString
}
NullString is an alias for sql.NullString data type.
func NewEmptyStr ¶
func NewEmptyStr() NullString
func NewStr ¶
func NewStr(str string) NullString
func NewStrNull ¶
func NewStrNull() NullString
func (NullString) MarshalJSON ¶
func (ns NullString) MarshalJSON() ([]byte, error)
MarshalJSON for NullString.
func (NullString) String ¶
func (ns NullString) String() string
func (*NullString) UnmarshalJSON ¶
func (ns *NullString) UnmarshalJSON(b []byte) error
UnmarshalJSON for NullString.
type NullTime ¶
NullTime is an alias for mysql.NullTime data type.
func NewTimeNull ¶
func NewTimeNull() NullTime
func (NullTime) MarshalJSON ¶
MarshalJSON for NullTime.
func (*NullTime) UnmarshalJSON ¶
UnmarshalJSON for NullTime.
type Pageable ¶
type Pageable struct { //TotalCount 总数量 TotalCount int64 `json:"totalCount"` //TotalPage 总页数 TotalPage int `json:"totalPage"` //Page 当前页数 Page int `json:"page"` //PageSize 每页数量 PageSize int `json:"pageSize"` //Rows 记录 Rows interface{} `json:"rows"` //HasNext 是否还有下一页 HasNext bool `json:"hasNext"` }
func NewPageable ¶
type RespOpt ¶
type RespOpt func(response *Response)
func RespWithCookies ¶
RespWithCookies 设置Cookie.
func RespWithHeaders ¶
RespWithHeaders 添加多个header.
type Response ¶
type Response struct { Cookie []*http.Cookie Header map[string]string Result interface{} StatusCode int }
func NewCustomResp ¶
NewCustomResp 自定义返回, 配合 CustomResponse 使用.
func (*Response) AddHeaders ¶
AddHeaders 添加请求头.
func (*Response) SetStatusCode ¶
SetStatusCode 设置状态码.
type Result ¶
type Result struct { //Code 业务状态码 Code int `json:"code" example:"0" swaggertype:"integer"` //Message 信息 Message string `json:"message" example:"Success" swaggertype:"string"` //Data 数据 Data interface{} `json:"data"` }
func NewErrResp ¶
func NewPageResult ¶
type ResultOpt ¶
type ResultOpt func(response *Result)
func ResultWithCode ¶
func ResultWithMessage ¶
type Set ¶ added in v1.1.9
type Set struct {
// contains filtered or unexported fields
}
Set 非线程安全Set.
func NewFloat32Set ¶ added in v1.4.1
func NewFloat64Set ¶ added in v1.4.1
func NewInt32Set ¶ added in v1.4.1
func NewInt64Set ¶ added in v1.4.1
func NewSimpleSet ¶
func NewSimpleSet() *Set
func (*Set) Float64Values ¶ added in v1.1.9
Float64Values 获取所有的值.
func (*Set) Int32Values ¶ added in v1.1.9
Int32Values 获取所有的值.
func (*Set) Int64Values ¶ added in v1.1.9
Int64Values 获取所有的值.
func (*Set) MustFloat64Values ¶ added in v1.3.5
MustFloat64Values 获取所有的值.
func (*Set) MustInt32Values ¶ added in v1.3.5
MustInt32Values 获取所有的值.
func (*Set) MustInt64Values ¶ added in v1.3.5
MustInt64Values 获取所有的值.
func (*Set) MustIntValues ¶ added in v1.3.5
MustIntValues 获取所有的值.
func (*Set) MustStrValues ¶ added in v1.3.5
MustStrValues 获取所有的值.
func (*Set) UpdateFloat32s ¶ added in v1.3.5
UpdateFloat32s 批量添加元素.
func (*Set) UpdateFloat64s ¶ added in v1.3.5
UpdateFloat64s 批量添加元素.
func (*Set) UpdateInt32s ¶ added in v1.3.5
UpdateInt32s 批量添加元素.
func (*Set) UpdateInt64s ¶ added in v1.3.5
UpdateInt64s 批量添加元素.
func (*Set) UpdateStrings ¶ added in v1.3.5
UpdateStrings 批量添加元素.