Documentation
¶
Index ¶
- Constants
- func ALL(path string, handler Handler)
- func DELETE(path string, handler Handler)
- func GET(path string, handler Handler)
- func HEAD(path string, handler Handler)
- func OPTIONS(path string, handler Handler)
- func PATCH(path string, handler Handler)
- func POST(path string, handler Handler)
- func PUT(path string, handler Handler)
- func Run() error
- func SetLoggerConfig(loggerConfig *LoggerConfig)
- func SetNotFoundHandle(nfh NotFoundHandle)
- func SetOrmConfig(ormConfig *OrmConfig)
- func SetPanicHandler(ph PanicHandler)
- func SetServerConfig(serverConfig *ServerConfig)
- func Use(m Middleware)
- type Application
- type Context
- func (c *Context) Body(body string)
- func (c *Context) Download(filePath string)
- func (c *Context) GetApp() *Application
- func (c *Context) GetHeader(key string) string
- func (c *Context) GetHeaders() map[string][]string
- func (c *Context) GetHost() string
- func (c *Context) GetHostname() string
- func (c *Context) GetHref() string
- func (c *Context) GetLength() int
- func (c *Context) GetMethod() string
- func (c *Context) GetOrigin() string
- func (c *Context) GetParam(key string) (value string)
- func (c *Context) GetParamDefault(key, defaultValue string) (value string)
- func (c *Context) GetProtocol() string
- func (c *Context) GetQuery() url.Values
- func (c *Context) GetQuerystring() string
- func (c *Context) GetStatusCode() int
- func (c *Context) GetUri() string
- func (c *Context) GetUserAgent() string
- func (c *Context) IsSecure() bool
- func (c *Context) Json(data map[string]interface{})
- func (c *Context) Parse(object interface{}) error
- func (c *Context) Redirect(url string, code int)
- func (c *Context) Render(tmpFile string, data map[string]interface{})
- func (c *Context) SetHeader(key, value string) *Context
- func (c *Context) SetLength(length int) *Context
- func (c *Context) SetStatus(code int) *Context
- type Handler
- type LoggerConfig
- type Middleware
- type Model
- type Next
- type NotFoundHandle
- type Orm
- type OrmConfig
- type OrmPool
- type PanicHandler
- type ServerConfig
Constants ¶
View Source
const ( HttpMethodGet = "GET" HttpMethodHead = "HEAD" HttpMethodOptions = "OPTIONS" HttpMethodPost = "POST" HttpMethodPut = "PUT" HttpMethodPatch = "PATCH" HttpMethodDelete = "DELETE" )
View Source
const ( HttpHeaderContentType = "Content-Type" HttpHeaderContentLength = "Content-Length" HttpHeaderTransferEncoding = "Transfer-Encoding" HttpHeaderContentDisposition = "Content-Disposition" HttpHeaderContentTransferEncoding = "Content-Transfer-Encoding" HttpHeaderExpires = "Expires" HttpHeaderCacheControl = "Cache-Control" HttpHeaderEtag = "Etag" HttpHeaderXForwardedHost = "X-Forwarded-Host" HttpHeaderXForwardedProto = "X-Forwarded-Proto" HttpHeaderIfModifiedSince = "If-Modified-Since" HttpHeaderIfNoneMatch = "If-None-Match" HttpHeaderLastModified = "Last-Modified" HttpHeaderXContentTypeOptions = "X-Content-Type-Options" HttpHeaderXPoweredBy = "X-Powered-By" )
Variables ¶
This section is empty.
Functions ¶
func SetLoggerConfig ¶ added in v1.2.0
func SetLoggerConfig(loggerConfig *LoggerConfig)
func SetNotFoundHandle ¶ added in v1.0.3
func SetNotFoundHandle(nfh NotFoundHandle)
func SetOrmConfig ¶ added in v1.2.0
func SetOrmConfig(ormConfig *OrmConfig)
func SetPanicHandler ¶ added in v1.0.3
func SetPanicHandler(ph PanicHandler)
func SetServerConfig ¶ added in v1.2.0
func SetServerConfig(serverConfig *ServerConfig)
func Use ¶ added in v1.0.3
func Use(m Middleware)
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
type Context ¶
func (*Context) GetApp ¶ added in v1.2.0
func (c *Context) GetApp() *Application
func (*Context) GetHeaders ¶
func (*Context) GetHostname ¶
func (*Context) GetParamDefault ¶
func (*Context) GetProtocol ¶
func (*Context) GetQuerystring ¶
func (*Context) GetStatusCode ¶ added in v1.0.8
func (*Context) GetUserAgent ¶ added in v1.0.2
type LoggerConfig ¶ added in v1.2.0
type Middleware ¶
type NotFoundHandle ¶ added in v1.0.2
type NotFoundHandle func(w http.ResponseWriter, r *http.Request)
func (NotFoundHandle) ServeHTTP ¶ added in v1.0.2
func (f NotFoundHandle) ServeHTTP(w http.ResponseWriter, r *http.Request)
type PanicHandler ¶ added in v1.0.2
type PanicHandler func(http.ResponseWriter, *http.Request, interface{})
Source Files
¶
Click to show internal directories.
Click to hide internal directories.