Versions in this module Expand all Collapse all v1 v1.1.4 Dec 4, 2016 Changes in this version + const AuthUserKey + const BindKey + const DebugMode + const ENV_GIN_MODE + const MIMEHTML + const MIMEJSON + const MIMEMultipartPOSTForm + const MIMEPOSTForm + const MIMEPlain + const MIMEXML + const MIMEXML2 + const ReleaseMode + const TestMode + const Version + var DefaultErrorWriter io.Writer = os.Stderr + var DefaultWriter io.Writer = os.Stdout + func Dir(root string, listDirectory bool) http.FileSystem + func DisableBindValidation() + func IsDebugging() bool + func Mode() string + func SetMode(value string) + type Accounts map[string]string + type Context struct + Accepted []string + Errors errorMsgs + Keys map[string]interface{} + Params Params + Request *http.Request + Writer ResponseWriter + func (c *Context) Abort() + func (c *Context) AbortWithError(code int, err error) *Error + func (c *Context) AbortWithStatus(code int) + func (c *Context) Bind(obj interface{}) error + func (c *Context) BindJSON(obj interface{}) error + func (c *Context) BindWith(obj interface{}, b binding.Binding) error + func (c *Context) ClientIP() string + func (c *Context) ContentType() string + func (c *Context) Cookie(name string) (string, error) + func (c *Context) Copy() *Context + func (c *Context) Data(code int, contentType string, data []byte) + func (c *Context) Deadline() (deadline time.Time, ok bool) + func (c *Context) DefaultPostForm(key, defaultValue string) string + func (c *Context) DefaultQuery(key, defaultValue string) string + func (c *Context) Done() <-chan struct{} + func (c *Context) Err() error + func (c *Context) Error(err error) *Error + func (c *Context) File(filepath string) + func (c *Context) Get(key string) (value interface{}, exists bool) + func (c *Context) GetCookie(name string) (string, error) + func (c *Context) GetPostForm(key string) (string, bool) + func (c *Context) GetPostFormArray(key string) ([]string, bool) + func (c *Context) GetQuery(key string) (string, bool) + func (c *Context) GetQueryArray(key string) ([]string, bool) + func (c *Context) HTML(code int, name string, obj interface{}) + func (c *Context) HandlerName() string + func (c *Context) Header(key, value string) + func (c *Context) IndentedJSON(code int, obj interface{}) + func (c *Context) IsAborted() bool + func (c *Context) JSON(code int, obj interface{}) + func (c *Context) MustGet(key string) interface{} + func (c *Context) Negotiate(code int, config Negotiate) + func (c *Context) NegotiateFormat(offered ...string) string + func (c *Context) Next() + func (c *Context) Param(key string) string + func (c *Context) PostForm(key string) string + func (c *Context) PostFormArray(key string) []string + func (c *Context) Query(key string) string + func (c *Context) QueryArray(key string) []string + func (c *Context) Redirect(code int, location string) + func (c *Context) Render(code int, r render.Render) + func (c *Context) SSEvent(name string, message interface{}) + func (c *Context) Set(key string, value interface{}) + func (c *Context) SetAccepted(formats ...string) + func (c *Context) SetCookie(name string, value string, maxAge int, path string, domain string, secure bool, ...) + func (c *Context) Status(code int) + func (c *Context) Stream(step func(w io.Writer) bool) + func (c *Context) String(code int, format string, values ...interface{}) + func (c *Context) Value(key interface{}) interface{} + func (c *Context) XML(code int, obj interface{}) + func (c *Context) YAML(code int, obj interface{}) + type Engine struct + ForwardedByClientIP bool + HTMLRender render.HTMLRender + HandleMethodNotAllowed bool + RedirectFixedPath bool + RedirectTrailingSlash bool + func Default() *Engine + func New() *Engine + func (engine *Engine) LoadHTMLFiles(files ...string) + func (engine *Engine) LoadHTMLGlob(pattern string) + func (engine *Engine) NoMethod(handlers ...HandlerFunc) + func (engine *Engine) NoRoute(handlers ...HandlerFunc) + func (engine *Engine) Routes() (routes RoutesInfo) + func (engine *Engine) Run(addr ...string) (err error) + func (engine *Engine) RunTLS(addr string, certFile string, keyFile string) (err error) + func (engine *Engine) RunUnix(file string) (err error) + func (engine *Engine) ServeHTTP(w http.ResponseWriter, req *http.Request) + func (engine *Engine) SetHTMLTemplate(templ *template.Template) + func (engine *Engine) Use(middleware ...HandlerFunc) IRoutes + type Error struct + Err error + Meta interface{} + Type ErrorType + func (msg *Error) Error() string + func (msg *Error) IsType(flags ErrorType) bool + func (msg *Error) JSON() interface{} + func (msg *Error) MarshalJSON() ([]byte, error) + func (msg *Error) SetMeta(data interface{}) *Error + func (msg *Error) SetType(flags ErrorType) *Error + type ErrorType uint64 + const ErrorTypeAny + const ErrorTypeBind + const ErrorTypeNu + const ErrorTypePrivate + const ErrorTypePublic + const ErrorTypeRender + type H map[string]interface + func (h H) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type HandlerFunc func(*Context) + func BasicAuth(accounts Accounts) HandlerFunc + func BasicAuthForRealm(accounts Accounts, realm string) HandlerFunc + func Bind(val interface{}) HandlerFunc + func ErrorLogger() HandlerFunc + func ErrorLoggerT(typ ErrorType) HandlerFunc + func Logger() HandlerFunc + func LoggerWithWriter(out io.Writer, notlogged ...string) HandlerFunc + func Recovery() HandlerFunc + func RecoveryWithWriter(out io.Writer) HandlerFunc + func WrapF(f http.HandlerFunc) HandlerFunc + func WrapH(h http.Handler) HandlerFunc + type HandlersChain []HandlerFunc + func (c HandlersChain) Last() HandlerFunc + type IRouter interface + Group func(string, ...HandlerFunc) *RouterGroup + type IRoutes interface + Any func(string, ...HandlerFunc) IRoutes + DELETE func(string, ...HandlerFunc) IRoutes + GET func(string, ...HandlerFunc) IRoutes + HEAD func(string, ...HandlerFunc) IRoutes + Handle func(string, string, ...HandlerFunc) IRoutes + OPTIONS func(string, ...HandlerFunc) IRoutes + PATCH func(string, ...HandlerFunc) IRoutes + POST func(string, ...HandlerFunc) IRoutes + PUT func(string, ...HandlerFunc) IRoutes + Static func(string, string) IRoutes + StaticFS func(string, http.FileSystem) IRoutes + StaticFile func(string, string) IRoutes + Use func(...HandlerFunc) IRoutes + type Negotiate struct + Data interface{} + HTMLData interface{} + HTMLName string + JSONData interface{} + Offered []string + XMLData interface{} + type Param struct + Key string + Value string + type Params []Param + func (ps Params) ByName(name string) (va string) + func (ps Params) Get(name string) (string, bool) + type ResponseWriter interface + Size func() int + Status func() int + WriteHeaderNow func() + WriteString func(string) (int, error) + Written func() bool + type RouteInfo struct + Handler string + Method string + Path string + type RouterGroup struct + Handlers HandlersChain + func (group *RouterGroup) Any(relativePath string, handlers ...HandlerFunc) IRoutes + func (group *RouterGroup) BasePath() string + func (group *RouterGroup) DELETE(relativePath string, handlers ...HandlerFunc) IRoutes + func (group *RouterGroup) GET(relativePath string, handlers ...HandlerFunc) IRoutes + func (group *RouterGroup) Group(relativePath string, handlers ...HandlerFunc) *RouterGroup + func (group *RouterGroup) HEAD(relativePath string, handlers ...HandlerFunc) IRoutes + func (group *RouterGroup) Handle(httpMethod, relativePath string, handlers ...HandlerFunc) IRoutes + func (group *RouterGroup) OPTIONS(relativePath string, handlers ...HandlerFunc) IRoutes + func (group *RouterGroup) PATCH(relativePath string, handlers ...HandlerFunc) IRoutes + func (group *RouterGroup) POST(relativePath string, handlers ...HandlerFunc) IRoutes + func (group *RouterGroup) PUT(relativePath string, handlers ...HandlerFunc) IRoutes + func (group *RouterGroup) Static(relativePath, root string) IRoutes + func (group *RouterGroup) StaticFS(relativePath string, fs http.FileSystem) IRoutes + func (group *RouterGroup) StaticFile(relativePath, filepath string) IRoutes + func (group *RouterGroup) Use(middleware ...HandlerFunc) IRoutes + type RoutesInfo []RouteInfo