Versions in this module Expand all Collapse all v1 v1.0.0 May 13, 2020 Changes in this version + var ContentType = struct{ ... } + func SetLang(lang Lang) + func SetMode(mode Runmode) + func Throw(err error) + func ToInt(s string) int64 + type AccessMap struct + func (a *AccessMap) Add(p string) + func (a *AccessMap) Get(p string) int64 + func (a *AccessMap) Sub(p string) + type Any map[string]interface + func (this Any) Get(k string) (v interface{}, exist bool) + func (this Any) GetBool(key string) (bool, bool) + func (this Any) GetFloat64(key string) (float64, bool) + func (this Any) GetInt64(key string) (int64, bool) + func (this Any) GetString(key string) (string, bool) + func (this Any) GetUint8(key string) (uint8, bool) + func (this Any) Set(k string, v interface{}) + type Code uint32 + const Aborted + const AlreadyExists + const Canceled + const DataLoss + const DeadlineExceeded + const FailedPrecondition + const Internal + const InvalidArgument + const NotFound + const OK + const OutOfRange + const PermissionDenied + const ResourceExhausted + const Unauthenticated + const Unavailable + const Unimplemented + const Unknown + func (c *Code) UnmarshalJSON(b []byte) error + type Context struct + ContentType string + Request *http.Request + Response http.ResponseWriter + Storage Any + func (c *Context) Abort() + func (c *Context) Bind(v interface{}) error + func (c *Context) ClientIP() string + func (c *Context) GetBody() []byte + func (c *Context) JSON(code int, v interface{}) error + func (c *Context) Next() + func (c *Context) Write(code int, body []byte) error + type CorsOption struct + AllowHeaders []string + AllowMethods []string + AllowOrigin string + MaxAge int + type Error struct + Code Code + Msg string + func NewError(code Code, msg string) *Error + func (this *Error) Error() string + func (this *Error) Wrap(msg string) *Error + type Group struct + func (g *Group) ANY(path string, handlers ...HandlerFunc) + func (g *Group) GET(path string, handlers ...HandlerFunc) + func (g *Group) Group(prefix string, handlers ...HandlerFunc) *Group + func (g *Group) POST(path string, handlers ...HandlerFunc) + type HandlerFunc func(ctx *Context) + func CORS(opt *CorsOption) HandlerFunc + func Limit(n int64) HandlerFunc + func Logger() HandlerFunc + type Lang uint8 + const Chinese + const English + type Runmode uint8 + const DebugMode + const ProductMode + func GetMode() Runmode + func (r Runmode) String() string + type Server struct + func New() *Server + func (s *Server) ANY(path string, handles ...HandlerFunc) + func (s *Server) GET(path string, handles ...HandlerFunc) + func (s *Server) Group(prefix string, handlers ...HandlerFunc) *Group + func (s *Server) POST(path string, handles ...HandlerFunc) + func (s *Server) Run(addr string) error + func (s *Server) ServeHTTP(res http.ResponseWriter, req *http.Request) + func (s *Server) SetCatch(fn func(ctx *Context, err interface{})) + func (s *Server) Use(handles ...HandlerFunc) + type TransError struct + Field string + Message string + func (this *TransError) Error() string