Versions in this module Expand all Collapse all v0 v0.0.1 Aug 8, 2023 Changes in this version + const GB + const HeaderAccept + const HeaderAcceptEncoding + const HeaderAccessControlAllowCredentials + const HeaderAccessControlAllowHeaders + const HeaderAccessControlAllowMethods + const HeaderAccessControlAllowOrigin + const HeaderAccessControlExposeHeaders + const HeaderAccessControlMaxAge + const HeaderAccessControlRequestHeaders + const HeaderAccessControlRequestMethod + const HeaderAllow + const HeaderAuthorization + const HeaderCacheControl + const HeaderConnection + const HeaderContentDisposition + const HeaderContentEncoding + const HeaderContentLength + const HeaderContentSecurityPolicy + const HeaderContentSecurityPolicyReportOnly + const HeaderContentType + const HeaderCookie + const HeaderIfModifiedSince + const HeaderLastModified + const HeaderLocation + const HeaderOrigin + const HeaderReferrerPolicy + const HeaderRetryAfter + const HeaderServer + const HeaderSetCookie + const HeaderStrictTransportSecurity + const HeaderUpgrade + const HeaderUserAgent + const HeaderVary + const HeaderWWWAuthenticate + const HeaderXCSRFToken + const HeaderXContentTypeOptions + const HeaderXCorrelationID + const HeaderXForwardedFor + const HeaderXForwardedProto + const HeaderXForwardedProtocol + const HeaderXForwardedSsl + const HeaderXFrameOptions + const HeaderXHTTPMethodOverride + const HeaderXRealIP + const HeaderXRequestID + const HeaderXRequestedWith + const HeaderXUrlScheme + const HeaderXXSSProtection + const KB + const MB + const MIMEApplicationForm + const MIMEApplicationJSON + const MIMEApplicationJSONCharsetUTF8 + const MIMEApplicationJavaScript + const MIMEApplicationJavaScriptCharsetUTF8 + const MIMEApplicationMsgpack + const MIMEApplicationProtobuf + const MIMEApplicationXML + const MIMEApplicationXMLCharsetUTF8 + const MIMEEventStream + const MIMEMultipartForm + const MIMEOctetStream + const MIMETextHTML + const MIMETextHTMLCharsetUTF8 + const MIMETextPlain + const MIMETextPlainCharsetUTF8 + const MIMETextXML + const MIMETextXMLCharsetUTF8 + const PB + const PROPFIND + const REPORT + const TB + const TranslatorLocaleEN + const TranslatorLocaleZH + var BusinessCodeError = -1 + var BusinessCodeOK = 0 + var BusinessMsgOk = "ok" + var Translator *translator + var UtTranslator ut.Translator + func Abs(path string) string + func AddStatusError(c *gin.Context, err error, codes ...int) + func ByteSize(path string) (int64, error) + func Clean(path string) + func ContextIResponse(c *gin.Context, response IResponse, statusRuleFuns ...IResponseStatusRuleFun) + func Copy(source string, dest string, ignoreErrors ...bool) error + func DefaultTranslator() *translator + func Exists(path string) bool + func FormatSize(bytesize int64, sigfig ...int) string + func IsDirectory(path string) bool + func IsExecutable(path string) bool + func IsFile(path string) bool + func IsReadable(path string) bool + func IsSymlink(path string) bool + func IsWritable(path string) bool + func JsonBaseResponse(c *gin.Context, v any) + func JsonError(ctx *gin.Context, err error, codes ...int) + func JsonErrorString(ctx *gin.Context, err string, codes ...int) + func JsonSuccess(ctx *gin.Context, data any, messages ...string) + func LastModified(path string) (time.Time, error) + func List(directory string, recursive bool, ignore ...string) ([]string, error) + func ListDirectories(directory string, recursive bool, ignore ...string) ([]string, error) + func ListFiles(directory string, recursive bool, ignore ...string) ([]string, error) + func Mkdir(path string) string + func Move(source string, dest string, ignoreErrors ...bool) error + func NewTranslator(supportedLocales []locales.Translator, ...) *translator + func ReadFile(path string) ([]byte, error) + func ReadTextFile(path string) (string, error) + func Size(path string, sigfig ...int) (string, error) + func Symlink(target string, name string) error + func Touch(path string, flags ...any) string + func WriteFile(path string, content string) (int, error) + func WriteTextFile(path string, content string, args ...any) error + func XmlBaseResponse(c *gin.Context, v any) + type BaseResponse struct + Code int + Data T + Msg string + type Engine struct + func Default() *Engine + func New() *Engine + func NewEngine(engine *gin.Engine) *Engine + func (e *Engine) BindingValidatorEngine(locale string, translators ...*translator) + func (e *Engine) Controller(controllers ...IController) + func (e *Engine) Plugin(Plugins ...IPlugin) + func (e *Engine) PrefixController(prefix string, controllers ...IController) + func (e *Engine) SetFuncMaps(funcMaps ...template.FuncMap) *Engine + type GinContext struct + func Context(c *gin.Context) *GinContext + func (c *GinContext) Form() url.Values + func (c *GinContext) Header() http.Header + func (c *GinContext) Host() string + func (c *GinContext) IsDelete() bool + func (c *GinContext) IsGet() bool + func (c *GinContext) IsHead() bool + func (c *GinContext) IsOptions() bool + func (c *GinContext) IsPatch() bool + func (c *GinContext) IsPost() bool + func (c *GinContext) IsPut() bool + func (c *GinContext) Path() string + func (c *GinContext) PostForm() url.Values + func (c *GinContext) URI() string + type IController interface + Prefix func() string + Routes func(g gin.IRoutes) + type IPlugin interface + Register func(group *gin.RouterGroup) + RouterPath func() string + type IResponse interface + Abort func() bool + Render func() render.Render + StatusCode func() int + WithStatusCode func(statusCode int) + type IResponseStatusRuleFun func(c *gin.Context, response IResponse) int + type JsonResponse struct + Code int + Data any + Error error + Message string + func (j *JsonResponse) Abort() bool + func (j *JsonResponse) Render() render.Render + func (j *JsonResponse) SetErr(err error) + func (j *JsonResponse) StatusCode() int + func (j *JsonResponse) WithMessage(message string) + func (j *JsonResponse) WithStatusCode(code int) + type LocaleRegisterDefaultTranslations func(locale string, v *validator.Validate, UtTranslator ut.Translator) + type ValidateError struct + Key string + Message string + func (v *ValidateError) Error() string + type ValidateErrors []*ValidateError + func (v ValidateErrors) Error() string + func (v ValidateErrors) Errors() []string