Documentation ¶
Index ¶
- Constants
- Variables
- func GetLocalIP() string
- func GetUUID() string
- func HandleCheck(pairs ...string) func(c *Context)
- func HandleGZIP(c *Context)
- func HandleHTML(c *Context)
- func HandleJSON(c *Context)
- func WaitForLoadConf()
- type Context
- func (c *Context) Byte(b []byte) (int, error)
- func (c *Context) Exit()
- func (c *Context) FormValue(key string) string
- func (c *Context) Get(key string) (val interface{}, ok bool)
- func (c *Context) GetCookie(key string) string
- func (c *Context) GetIP() string
- func (c *Context) GetRawData() string
- func (c *Context) JSON(v map[string]interface{})
- func (c *Context) JSONAPI(code int, data interface{})
- func (c *Context) Load(p ...string)
- func (c *Context) LoadByData(data interface{}, p ...string)
- func (c *Context) LoadByDataAndFunc(p string, data interface{}, funcmap template.FuncMap)
- func (c *Context) Redirect(url string)
- func (c *Context) SaveFile(filed, path string) (string, error)
- func (c *Context) Set(key string, val interface{})
- func (c *Context) SetCookie(key, value string, maxAge int)
- func (c *Context) String(s string)
- func (c *Context) SuccessMap() (map[string]interface{}, map[string]interface{})
- func (c *Context) Template(data interface{})
- type FileHandler
- type GroupYoyo
- func (g *GroupYoyo) DELETE(path string, handle ...Handle)
- func (g *GroupYoyo) GET(path string, handle ...Handle)
- func (g *GroupYoyo) Group(prefix string) *GroupYoyo
- func (g *GroupYoyo) HEAD(path string, handle ...Handle)
- func (g *GroupYoyo) HanderFunc(method, path string, hander http.HandlerFunc)
- func (g *GroupYoyo) Handle(method, path string, handle ...Handle)
- func (g *GroupYoyo) OPTIONS(path string, handle ...Handle)
- func (g *GroupYoyo) PATCH(path string, handle ...Handle)
- func (g *GroupYoyo) POST(path string, handle ...Handle)
- func (g *GroupYoyo) PUT(path string, handle ...Handle)
- func (g *GroupYoyo) PreHandle(handle ...Handle)
- func (g *GroupYoyo) StaticFile(path string)
- func (g *GroupYoyo) TailHandle(handle ...Handle)
- type GzipResponseWriter
- type Handle
- type UUID
- type Yoyo
Constants ¶
View Source
const ( MIMEJSON = "application/json" MIMEHTML = "text/html" )
Variables ¶
View Source
var Conf tomlConfig
View Source
var IsLoadedConf = false
View Source
var IsLocal = false
Functions ¶
Types ¶
type Context ¶
type Context struct { W http.ResponseWriter R *http.Request PS httprouter.Params StartTime time.Time UUID string // contains filtered or unexported fields }
func (*Context) LoadByDataAndFunc ¶
func (*Context) SaveFile ¶
文件助手 path 相对路径名 path最前面加/表示相对路径,不加表示绝对路径
func (*Context) SuccessMap ¶
type FileHandler ¶
type FileHandler struct {
// contains filtered or unexported fields
}
静态文件处理Handler
func (*FileHandler) ServeHTTP ¶
func (f *FileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GroupYoyo ¶
type GroupYoyo struct {
// contains filtered or unexported fields
}
func (*GroupYoyo) HanderFunc ¶
func (g *GroupYoyo) HanderFunc(method, path string, hander http.HandlerFunc)
type GzipResponseWriter ¶
type GzipResponseWriter struct {
// contains filtered or unexported fields
}
func NewGzipResponseWriter ¶
func NewGzipResponseWriter(rw http.ResponseWriter) *GzipResponseWriter
func (*GzipResponseWriter) Close ¶
func (g *GzipResponseWriter) Close()
func (*GzipResponseWriter) Header ¶
func (g *GzipResponseWriter) Header() http.Header
func (*GzipResponseWriter) Write ¶
func (g *GzipResponseWriter) Write(b []byte) (int, error)
func (*GzipResponseWriter) WriteHeader ¶
func (g *GzipResponseWriter) WriteHeader(code int)
type UUID ¶
type UUID struct {
// contains filtered or unexported fields
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.