Documentation ¶
Index ¶
Constants ¶
View Source
const ( AppAPI = "appapi" OpenAPI = "openapi" )
Variables ¶
View Source
var ( ErrBadParams = errs.NewI18nError("err.badparams").FallBack("invalid params").Status(http.StatusBadRequest).Code(code.BadRequest) ErrForbidden = errs.NewI18nError("err.forbidden").FallBack("forbidden").Status(http.StatusForbidden).Code(code.Forbidden) ErrUnAthorzied = errs.NewI18nError("err.unauthorized").FallBack("unauthorized").Status(http.StatusUnauthorized).Code(code.UnAuthorized) ErrResourceNotFound = errs.NewI18nError("err.notfound").FallBack("resource not found").Status(http.StatusNotFound).Code(code.ResourceNotFound) )
View Source
var ( // ErrDatabase // This error is used to describe database operations. // These operations may not have any exceptions themselves, but they have not caused any impact, so they are invalid operations. ErrDatabase = errs.NewI18nError("err.database").FallBack("database error").Status(http.StatusInternalServerError).Code(code.DatabaseError) ErrFileSystem = errs.NewI18nError("err.filesystem").FallBack("file system error").Status(http.StatusInternalServerError).Code(code.FilesystemError) ErrNetwork = errs.NewI18nError("err.network").FallBack("network error").Status(http.StatusInternalServerError).Code(code.NetworkError) ErrProgram = errs.NewI18nError("err.program").FallBack("program error").Status(http.StatusInternalServerError).Code(code.ProgramError) ErrUnknown = errs.NewI18nError("err.unknown").FallBack("unknown error").Status(http.StatusInternalServerError).Code(code.UnknownError) )
View Source
var (
RulePing = helper.Rules(vax.RangeLenRune(1, 10), vax.In("wilson", "wendy"))
)
Functions ¶
This section is empty.
Types ¶
type Id ¶
type Id struct {
Id string `json:"id" uri:"id" form:"id" label:"field.id"`
}
Id represent query or path param ID
type PingReply ¶
type PingReply struct {
Reply string `json:"reply" example:"hello wendy! Now is 2023-10-17 11:07:21.696 +08:00."`
}
type PingRequest ¶
type PingRequest struct { // name must be one of [wilson, wendy] Name string `json:"name" uri:"name" form:"name" label:"field.name" example:"wilson"` }
func (PingRequest) Validate ¶
func (p PingRequest) Validate(lang string) error
Click to show internal directories.
Click to hide internal directories.