Documentation ¶
Index ¶
- Variables
- func NewError(e error) error
- func PackageInfo() types.PackageInfo
- func PackageName() string
- func PackageVersion() types.Version
- func ReqsFieldCheck(fields map[string]ReqsField) map[string][]Error
- func ReqsFieldRule_Integer(dest *int) func(t *string) error
- func ReqsFieldRule_IntegerRange(dest *int, min, max int) func(t *string) error
- func ReqsFieldRule_KSUidChecker(id *string) error
- func ReqsFieldRule_LengthChecker(min, max int, emptyAsNil bool) func(*string) error
- func ReqsFieldRule_MailAddressChecker(dest *string) func(i *string) error
- func ReqsFieldRule_Nullable(validator func(i *string) error) func(i *string) error
- func ReqsFieldRule_Timestamp(t *string) error
- func ReqsFieldRule_TimestampDuring(startAt, endAt time.Time) func(t *string) error
- func ReqsFieldRule_URLChecker(urlRaw *string) error
- func ReqsFieldRule_XidChecker(id *string) error
- func ReqsFormData(request *http.Request, template map[string]string) (map[string]*string, error)
- func URIMergeQuery(rawUrl *url.URL, data map[string]string) (string, error)
- type Error
- type ReqsField
- type ReqsFieldRule
- type RespError
- type RespOutput
- type RespThrowable
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TM_InvalidInput = types.NewMask( "invalid input", "非法的输入", ) EM_InternalError = types.NewMask( "internal error", "内部错误${{id}}", ) TM_InternalError = types.NewMask( "internal error", "内部错误", ) )
View Source
var ReqsFieldError_InvalidDataLength = fmt.Errorf("invalid data length")
View Source
var ReqsFieldError_InvalidInteger = fmt.Errorf("invalid integer")
View Source
var ReqsFieldError_InvalidKSUid = fmt.Errorf("invalid ksuid")
View Source
var ReqsFieldError_InvalidMailAddress = fmt.Errorf("invalid mail address")
View Source
var ReqsFieldError_InvalidOutOfRange = fmt.Errorf("invalid out of range")
View Source
var ReqsFieldError_InvalidTimestamp = fmt.Errorf("invalid timestamp")
View Source
var ReqsFieldError_InvalidURI = fmt.Errorf("invalid uri")
View Source
var ReqsFieldError_InvalidURIScheme = fmt.Errorf("invalid uri scheme")
View Source
var ReqsFieldError_InvalidXid = fmt.Errorf("invalid xid")
View Source
var ReqsFieldError_MissingData = fmt.Errorf("missing data")
View Source
var ReqsFieldError_TimestampOutOfRange = fmt.Errorf("timestamp out of range")
Functions ¶
func PackageInfo ¶
func PackageInfo() types.PackageInfo
func PackageName ¶
func PackageName() string
func PackageVersion ¶
func ReqsFieldRule_Integer ¶
func ReqsFieldRule_Nullable ¶
func ReqsFieldRule_Timestamp ¶
func ReqsFormData ¶
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func (Error) MarshalJSON ¶
type ReqsField ¶
type ReqsField struct { Data *string Rules []ReqsFieldRule }
type ReqsFieldRule ¶
type RespOutput ¶
type RespOutput struct { Message string `json:"message"` Data interface{} `json:"data"` }
type RespThrowable ¶
type RespThrowable struct {
// contains filtered or unexported fields
}
func NewRespThrowable ¶
func NewRespThrowable(mask types.Mask, param map[string]string, cause interface{}) *RespThrowable
func (*RespThrowable) Cause ¶
func (rt *RespThrowable) Cause() error
func (*RespThrowable) Error ¶
func (rt *RespThrowable) Error() string
func (*RespThrowable) GetMask ¶
func (rt *RespThrowable) GetMask() string
func (*RespThrowable) GetMessage ¶
func (rt *RespThrowable) GetMessage() string
Click to show internal directories.
Click to hide internal directories.