Documentation
¶
Index ¶
- Constants
- type MultiErr
- type NullBool
- type NullFloat64
- func (nf NullFloat64) Empty() bool
- func (nf *NullFloat64) Equal(v NullFloat64) bool
- func (nf *NullFloat64) IsNil() bool
- func (nf NullFloat64) MarshalJSON() ([]byte, error)
- func (nf NullFloat64) String() string
- func (nf *NullFloat64) UnmarshalJSON(b []byte) error
- func (nf *NullFloat64) Value() float64
- type NullInt
- type NullInt64
- type NullString
- type NullTime
- type Pageable
- type RespOpt
- type Response
- type Result
- type ResultOpt
Constants ¶
const ( OK = 0 SUCCESS = "Success" InvalidParams = 10000 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 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 { Cookies []*http.Cookie Header map[string]string Result *Result StatusCode int }
func NewCustomResp ¶
NewCustomResp 自定义返回, 配合 CustomResponse 使用
func (*Response) AddHeaders ¶
AddHeaders 添加请求头
func (*Response) SetStatusCode ¶
SetStatusCode 设置状态码