Documentation
¶
Index ¶
- type IchubResult
- func FailResult(msg string) *IchubResult
- func NewIchubResult() *IchubResult
- func ParseIchubResult(body []byte) *IchubResult
- func ResultCodeMsg(code int, msg string) *IchubResult
- func ResultData(data interface{}) *IchubResult
- func ResultError(err error) *IchubResult
- func ResultFailError(err error) *IchubResult
- func ResultFailMsg(msg string) *IchubResult
- func ResultSuccessData(data interface{}) *IchubResult
- func (self *IchubResult) Check(suite suite.Suite, keyVal string)
- func (self *IchubResult) CheckCode(suite suite.Suite, code int)
- func (self *IchubResult) CheckErr(s suite.Suite, err error)
- func (self *IchubResult) CheckRecord(exp string) error
- func (self *IchubResult) CheckRecordSuite(s suite.Suite, exp string)
- func (self *IchubResult) CheckValueByKey(key string, expect any) bool
- func (self *IchubResult) Checks(suite suite.Suite, keyVals string)
- func (self *IchubResult) CodeMsg(code int, msg string) *IchubResult
- func (self *IchubResult) DataIfMap() map[string]interface{}
- func (self *IchubResult) DataIfResultParams() *IchubResultParams
- func (self *IchubResult) ExistRecord() bool
- func (self *IchubResult) Fail() *IchubResult
- func (self *IchubResult) FailMessage(msg string) *IchubResult
- func (self *IchubResult) FailMsg(msg string) *IchubResult
- func (self *IchubResult) FromJson(body []byte) (*IchubResult, error)
- func (self *IchubResult) GetData() any
- func (self *IchubResult) GetDbResult() map[string]any
- func (self *IchubResult) GetEsResult() map[string]any
- func (self *IchubResult) Init()
- func (self *IchubResult) IsFailed() bool
- func (self *IchubResult) IsSuccess() bool
- func (self *IchubResult) ParseData(model interface{}) *IchubResult
- func (self *IchubResult) ParseRemote(model interface{}) *IchubResult
- func (self *IchubResult) ParseResult() *IchubResult
- func (self *IchubResult) Result2Err() error
- func (self *IchubResult) SetData(s any)
- func (self *IchubResult) Shutdown()
- func (self *IchubResult) String() string
- func (self *IchubResult) Success() *IchubResult
- func (self *IchubResult) SuccessData(data any) *IchubResult
- func (self *IchubResult) SuccessMessage(msg string, data any) *IchubResult
- func (self *IchubResult) To(out interface{})
- func (self *IchubResult) ToBytes() []byte
- func (self *IchubResult) ToString() string
- func (self *IchubResult) ValueByKey(key string) any
- func (self *IchubResult) ValueOfKey(key string) *gvar.Var
- type IchubResultParam
- func (p *IchubResultParam) CheckType(i interface{}) string
- func (p *IchubResultParam) CheckTypeParam() string
- func (p *IchubResultParam) From(value any) *IchubResultParam
- func (p *IchubResultParam) IfBool() bool
- func (p *IchubResultParam) IfByte() bool
- func (p *IchubResultParam) IfFloat32() bool
- func (p *IchubResultParam) IfFloat64() bool
- func (p *IchubResultParam) IfInt() bool
- func (p *IchubResultParam) IfInt8() bool
- func (p *IchubResultParam) IfInt16() bool
- func (p *IchubResultParam) IfInt32() bool
- func (p *IchubResultParam) IfInt64() bool
- func (p *IchubResultParam) IfStr() bool
- func (p *IchubResultParam) IfString() bool
- func (p *IchubResultParam) IfUInt8() bool
- func (p *IchubResultParam) IfUInt16() bool
- func (p *IchubResultParam) IfUInt32() bool
- func (p *IchubResultParam) IfUInt64() bool
- func (p *IchubResultParam) SetValue(value any)
- func (p *IchubResultParam) String() string
- func (p *IchubResultParam) ToBool() (ivalue bool)
- func (p *IchubResultParam) ToByte() byte
- func (p *IchubResultParam) ToBytes() []byte
- func (p *IchubResultParam) ToFloat32() (ivalue float32)
- func (p *IchubResultParam) ToFloat64() (ivalue float64)
- func (p *IchubResultParam) ToInt() int
- func (p *IchubResultParam) ToInt8() (ivalue int8)
- func (p *IchubResultParam) ToInt16() (ivalue int16)
- func (p *IchubResultParam) ToInt32() (ivalue int32)
- func (p *IchubResultParam) ToInt64() (ivalue int64)
- func (p *IchubResultParam) ToString() string
- func (p *IchubResultParam) ToUIn8() uint8
- func (p *IchubResultParam) ToUInt() uint
- func (p *IchubResultParam) ToUInt16() (ivalue uint16)
- func (p *IchubResultParam) ToUInt32() (ivalue uint32)
- func (p *IchubResultParam) ToUInt64() (ivalue uint64)
- func (p *IchubResultParam) Value() any
- type IchubResultParams
- func (p *IchubResultParams) GetMap(key string) map[string]any
- func (p *IchubResultParams) GetParam(key string) *IchubResultParam
- func (p *IchubResultParams) GetParams(key string) *IchubResultParams
- func (p *IchubResultParams) SetParam(key string, value any)
- func (this *IchubResultParams) ValueOf(m map[string]any) *IchubResultParams
- type IchubResults
- func (results *IchubResults) CheckCode(suite suite.Suite, code int)
- func (results *IchubResults) Fail() *IchubResults
- func (results *IchubResults) FailMessage(msg string) *IchubResults
- func (results *IchubResults) FromJson(body []byte) (*IchubResults, error)
- func (results *IchubResults) GetData() []*IchubResult
- func (results *IchubResults) IsFailed() bool
- func (results *IchubResults) IsFailedAny() bool
- func (results *IchubResults) IsSuccess() bool
- func (results *IchubResults) Log()
- func (results *IchubResults) SetData(s []*IchubResult)
- func (results *IchubResults) String() (s string)
- func (results *IchubResults) Success() *IchubResults
- func (results *IchubResults) SuccessData(data []*IchubResult) *IchubResults
- func (results *IchubResults) SuccessMsg(msg string, data ...*IchubResult) *IchubResults
- func (results *IchubResults) ToString() string
- func (results *IchubResults) ValueOf(index int) *IchubResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IchubResult ¶
type IchubResult struct {
basedto.BaseEntity
//返回码
Code int `json:"code,omitempty"`
//信息
Msg string `json:"msg,omitempty"`
//数据
Data any `json:"data,omitempty"`
Exist bool `json:"exist"`
Url string `json:"url,omitempty"`
IfCache bool `json:"if_cache"`
}
func FailResult ¶
func FailResult(msg string) *IchubResult
func NewIchubResult ¶
func NewIchubResult() *IchubResult
func ParseIchubResult ¶
func ParseIchubResult(body []byte) *IchubResult
func ResultCodeMsg ¶
func ResultCodeMsg(code int, msg string) *IchubResult
func ResultData ¶
func ResultData(data interface{}) *IchubResult
@Title 文件名称: ichubresult.go @Description 描述: 统一返回结构
@Author 作者: leijianming@163.com 时间(2024-02-18 22:38:21) @Update 作者: leijianming@163.com 时间(2024-02-18 22:38:21)
func ResultError ¶
func ResultError(err error) *IchubResult
func ResultFailError ¶
func ResultFailError(err error) *IchubResult
func ResultFailMsg ¶
func ResultFailMsg(msg string) *IchubResult
func ResultSuccessData ¶
func ResultSuccessData(data interface{}) *IchubResult
func (*IchubResult) CheckRecord ¶
func (self *IchubResult) CheckRecord(exp string) error
func (*IchubResult) CheckRecordSuite ¶
func (self *IchubResult) CheckRecordSuite(s suite.Suite, exp string)
func (*IchubResult) CheckValueByKey ¶
func (self *IchubResult) CheckValueByKey(key string, expect any) bool
func (*IchubResult) Checks ¶
func (self *IchubResult) Checks(suite suite.Suite, keyVals string)
keyVal : "Pay=12|l=2"
func (*IchubResult) CodeMsg ¶
func (self *IchubResult) CodeMsg(code int, msg string) *IchubResult
func (*IchubResult) DataIfMap ¶
func (self *IchubResult) DataIfMap() map[string]interface{}
func (*IchubResult) DataIfResultParams ¶
func (self *IchubResult) DataIfResultParams() *IchubResultParams
func (*IchubResult) ExistRecord ¶
func (self *IchubResult) ExistRecord() bool
func (*IchubResult) Fail ¶
func (self *IchubResult) Fail() *IchubResult
func (*IchubResult) FailMessage ¶
func (self *IchubResult) FailMessage(msg string) *IchubResult
func (*IchubResult) FailMsg ¶
func (self *IchubResult) FailMsg(msg string) *IchubResult
func (*IchubResult) FromJson ¶
func (self *IchubResult) FromJson(body []byte) (*IchubResult, error)
func DataOfIndex(1)
func (*IchubResult) GetData ¶
func (self *IchubResult) GetData() any
func (*IchubResult) GetDbResult ¶
func (self *IchubResult) GetDbResult() map[string]any
func (*IchubResult) GetEsResult ¶
func (self *IchubResult) GetEsResult() map[string]any
func (*IchubResult) Init ¶
func (self *IchubResult) Init()
func (*IchubResult) IsFailed ¶
func (self *IchubResult) IsFailed() bool
func (*IchubResult) IsSuccess ¶
func (self *IchubResult) IsSuccess() bool
func (*IchubResult) ParseData ¶
func (self *IchubResult) ParseData(model interface{}) *IchubResult
func (*IchubResult) ParseRemote ¶
func (self *IchubResult) ParseRemote(model interface{}) *IchubResult
func (*IchubResult) ParseResult ¶
func (self *IchubResult) ParseResult() *IchubResult
func (*IchubResult) Result2Err ¶
func (self *IchubResult) Result2Err() error
func (*IchubResult) SetData ¶
func (self *IchubResult) SetData(s any)
func (*IchubResult) Shutdown ¶
func (self *IchubResult) Shutdown()
func (*IchubResult) String ¶
func (self *IchubResult) String() string
func (*IchubResult) Success ¶
func (self *IchubResult) Success() *IchubResult
func (*IchubResult) SuccessData ¶
func (self *IchubResult) SuccessData(data any) *IchubResult
func (*IchubResult) SuccessMessage ¶
func (self *IchubResult) SuccessMessage(msg string, data any) *IchubResult
func (*IchubResult) To ¶
func (self *IchubResult) To(out interface{})
func (*IchubResult) ToBytes ¶
func (self *IchubResult) ToBytes() []byte
func (*IchubResult) ToString ¶
func (self *IchubResult) ToString() string
func (*IchubResult) ValueByKey ¶
func (self *IchubResult) ValueByKey(key string) any
func (*IchubResult) ValueOfKey ¶
func (self *IchubResult) ValueOfKey(key string) *gvar.Var
type IchubResultParam ¶
type IchubResultParam struct {
basedto.BaseEntity
// contains filtered or unexported fields
}
@Title 文件名称: ichub_param.go @Description 描述: 有芯规则引擎执行的参数值对象
应该进行值类型转换,转成string,再转成各类型
@Author 作者: leijianming@163.com 时间(2024-02-18 22:38:21) @Update 作者: leijianming@163.com 时间(2024-02-18 22:38:21)
规则体支持的基础数据类型 string bool int, int8, int16, int32, int64 uint uint8, uint16,uint32, uint64 float32 float64
func NewIchubResultParam ¶
func NewIchubResultParam(value any) *IchubResultParam
func (*IchubResultParam) CheckType ¶
func (p *IchubResultParam) CheckType(i interface{}) string
func (*IchubResultParam) CheckTypeParam ¶
func (p *IchubResultParam) CheckTypeParam() string
func (*IchubResultParam) From ¶
func (p *IchubResultParam) From(value any) *IchubResultParam
func (*IchubResultParam) IfBool ¶
func (p *IchubResultParam) IfBool() bool
func (*IchubResultParam) IfByte ¶
func (p *IchubResultParam) IfByte() bool
func (*IchubResultParam) IfFloat32 ¶
func (p *IchubResultParam) IfFloat32() bool
func (*IchubResultParam) IfFloat64 ¶
func (p *IchubResultParam) IfFloat64() bool
func (*IchubResultParam) IfInt ¶
func (p *IchubResultParam) IfInt() bool
func (*IchubResultParam) IfInt8 ¶
func (p *IchubResultParam) IfInt8() bool
func (*IchubResultParam) IfInt16 ¶
func (p *IchubResultParam) IfInt16() bool
func (*IchubResultParam) IfInt32 ¶
func (p *IchubResultParam) IfInt32() bool
func (*IchubResultParam) IfInt64 ¶
func (p *IchubResultParam) IfInt64() bool
func (*IchubResultParam) IfStr ¶
func (p *IchubResultParam) IfStr() bool
func (*IchubResultParam) IfString ¶
func (p *IchubResultParam) IfString() bool
func (*IchubResultParam) IfUInt8 ¶
func (p *IchubResultParam) IfUInt8() bool
func (*IchubResultParam) IfUInt16 ¶
func (p *IchubResultParam) IfUInt16() bool
func (*IchubResultParam) IfUInt32 ¶
func (p *IchubResultParam) IfUInt32() bool
func (*IchubResultParam) IfUInt64 ¶
func (p *IchubResultParam) IfUInt64() bool
func (*IchubResultParam) SetValue ¶
func (p *IchubResultParam) SetValue(value any)
func (*IchubResultParam) String ¶
func (p *IchubResultParam) String() string
func (*IchubResultParam) ToBool ¶
func (p *IchubResultParam) ToBool() (ivalue bool)
func (*IchubResultParam) ToByte ¶
func (p *IchubResultParam) ToByte() byte
func (*IchubResultParam) ToBytes ¶
func (p *IchubResultParam) ToBytes() []byte
func (*IchubResultParam) ToFloat32 ¶
func (p *IchubResultParam) ToFloat32() (ivalue float32)
func (*IchubResultParam) ToFloat64 ¶
func (p *IchubResultParam) ToFloat64() (ivalue float64)
func (*IchubResultParam) ToInt ¶
func (p *IchubResultParam) ToInt() int
func (*IchubResultParam) ToInt8 ¶
func (p *IchubResultParam) ToInt8() (ivalue int8)
func (*IchubResultParam) ToInt16 ¶
func (p *IchubResultParam) ToInt16() (ivalue int16)
func (*IchubResultParam) ToInt32 ¶
func (p *IchubResultParam) ToInt32() (ivalue int32)
func (*IchubResultParam) ToInt64 ¶
func (p *IchubResultParam) ToInt64() (ivalue int64)
func (*IchubResultParam) ToString ¶
func (p *IchubResultParam) ToString() string
func (*IchubResultParam) ToUIn8 ¶
func (p *IchubResultParam) ToUIn8() uint8
func (*IchubResultParam) ToUInt ¶
func (p *IchubResultParam) ToUInt() uint
func (*IchubResultParam) ToUInt16 ¶
func (p *IchubResultParam) ToUInt16() (ivalue uint16)
func (*IchubResultParam) ToUInt32 ¶
func (p *IchubResultParam) ToUInt32() (ivalue uint32)
func (*IchubResultParam) ToUInt64 ¶
func (p *IchubResultParam) ToUInt64() (ivalue uint64)
非int64也支持强制转换
func (*IchubResultParam) Value ¶
func (p *IchubResultParam) Value() any
type IchubResultParams ¶
type IchubResultParams struct {
Params map[string]any `json:"params"`
basedto.BaseEntity
}
func NewIchubResultParams ¶
func NewIchubResultParams() *IchubResultParams
func (*IchubResultParams) GetParam ¶
func (p *IchubResultParams) GetParam(key string) *IchubResultParam
func (*IchubResultParams) GetParams ¶
func (p *IchubResultParams) GetParams(key string) *IchubResultParams
func (*IchubResultParams) SetParam ¶
func (p *IchubResultParams) SetParam(key string, value any)
func (*IchubResultParams) ValueOf ¶
func (this *IchubResultParams) ValueOf(m map[string]any) *IchubResultParams
type IchubResults ¶
type IchubResults struct {
basedto.BaseEntity
Code int `json:"code"`
Msg string `json:"msg"`
Data []*IchubResult `json:"data,omitempty"`
}
func NewIchubResults ¶
func NewIchubResults() *IchubResults
func ParseIchubResults ¶
func ParseIchubResults(body []byte) *IchubResults
func SuccessIchubResults ¶
func SuccessIchubResults() *IchubResults
func SuccessIchubResultsData ¶
func SuccessIchubResultsData(data []*IchubResult) *IchubResults
@Title 文件名称: ichubresults.go @Description 描述: 批量统一返回结构
@Author 作者: leijianming@163.com 时间(2024-02-18 22:38:21) @Update 作者: leijianming@163.com 时间(2024-02-18 22:38:21)
func (*IchubResults) CheckCode ¶
func (results *IchubResults) CheckCode(suite suite.Suite, code int)
func (*IchubResults) Fail ¶
func (results *IchubResults) Fail() *IchubResults
func (*IchubResults) FailMessage ¶
func (results *IchubResults) FailMessage(msg string) *IchubResults
func (*IchubResults) FromJson ¶
func (results *IchubResults) FromJson(body []byte) (*IchubResults, error)
func DataOfIndex(1)
func (*IchubResults) GetData ¶
func (results *IchubResults) GetData() []*IchubResult
func (*IchubResults) IsFailed ¶
func (results *IchubResults) IsFailed() bool
func (*IchubResults) IsFailedAny ¶
func (results *IchubResults) IsFailedAny() bool
func (*IchubResults) IsSuccess ¶
func (results *IchubResults) IsSuccess() bool
func (*IchubResults) Log ¶
func (results *IchubResults) Log()
func (*IchubResults) SetData ¶
func (results *IchubResults) SetData(s []*IchubResult)
func (*IchubResults) String ¶
func (results *IchubResults) String() (s string)
func (*IchubResults) Success ¶
func (results *IchubResults) Success() *IchubResults
func (*IchubResults) SuccessData ¶
func (results *IchubResults) SuccessData(data []*IchubResult) *IchubResults
func (*IchubResults) SuccessMsg ¶
func (results *IchubResults) SuccessMsg(msg string, data ...*IchubResult) *IchubResults
func (*IchubResults) ToString ¶
func (results *IchubResults) ToString() string
func (*IchubResults) ValueOf ¶
func (results *IchubResults) ValueOf(index int) *IchubResult