Documentation ¶
Index ¶
- func BeforeStart(fn func(server *Server))
- func BeforeStop(fn func(server *Server))
- type DefaultLogWriter
- type FileLogWriter
- type LogWriter
- type Server
- func (this *Server) AccessLog(bool bool) *Server
- func (this *Server) All(path string, actionPtr interface{}) *Server
- func (this *Server) Any(methods []string, path string, actionPtr interface{}) *Server
- func (this *Server) ConnState(connState func(conn net.Conn, state http.ConnState)) *Server
- func (this *Server) Connect(path string, actionPtr interface{}) *Server
- func (this *Server) Data(name string, value interface{}) *Server
- func (this *Server) Delete(path string, actionPtr interface{}) *Server
- func (this *Server) EndAll() *Server
- func (this *Server) EndData() *Server
- func (this *Server) EndHelpers() *Server
- func (this *Server) EndModule() *Server
- func (this *Server) EndPrefix() *Server
- func (this *Server) Get(path string, actionPtr interface{}) *Server
- func (this *Server) GetPost(path string, actionPtr interface{}) *Server
- func (this *Server) Head(path string, actionPtr interface{}) *Server
- func (this *Server) Helper(helper interface{}) *Server
- func (this *Server) InternalErrorLogger(errorLogger *log.Logger) *Server
- func (this *Server) LogWriter(logWriter LogWriter) *Server
- func (this *Server) Module(module string) *Server
- func (this *Server) Options(path string, actionPtr interface{}) *Server
- func (this *Server) Post(path string, actionPtr interface{}) *Server
- func (this *Server) Prefix(prefix string) *Server
- func (this *Server) Purge(path string, actionPtr interface{}) *Server
- func (this *Server) Put(path string, actionPtr interface{}) *Server
- func (this *Server) ReadHeaderTimeout(timeout time.Duration) *Server
- func (this *Server) ReadTimeout(timeout time.Duration) *Server
- func (this *Server) Session(sessionManager interface{}, cookieName string) *Server
- func (this *Server) Start()
- func (this *Server) StartOn(address string)
- func (this *Server) Static(prefix string, dir string) *Server
- func (this *Server) Stop()
- func (this *Server) Trace(path string, actionPtr interface{}) *Server
- type ServerConfig
- type ServerRoutePattern
- type ServerStaticDir
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DefaultLogWriter ¶
type DefaultLogWriter struct {
// contains filtered or unexported fields
}
func (*DefaultLogWriter) Close ¶
func (this *DefaultLogWriter) Close()
func (*DefaultLogWriter) Init ¶
func (this *DefaultLogWriter) Init()
func (*DefaultLogWriter) Print ¶
func (this *DefaultLogWriter) Print(t time.Time, response *responseWriter, request *http.Request)
func (*DefaultLogWriter) Write ¶
func (this *DefaultLogWriter) Write(logMessage string)
type FileLogWriter ¶
type FileLogWriter struct { File string // contains filtered or unexported fields }
func (*FileLogWriter) Close ¶
func (this *FileLogWriter) Close()
func (*FileLogWriter) Init ¶
func (this *FileLogWriter) Init()
func (*FileLogWriter) Print ¶
func (this *FileLogWriter) Print(t time.Time, response *responseWriter, request *http.Request)
func (*FileLogWriter) Write ¶
func (this *FileLogWriter) Write(logMessage string)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server Web服务
func (*Server) InternalErrorLogger ¶
func (*Server) ReadHeaderTimeout ¶
type ServerConfig ¶
type ServerConfig struct { Http struct { On bool `yaml:"on" json:"on"` Listen []string `yaml:"listen" json:"listen"` // 监听地址,带端口 RedirectToHTTPS bool `yaml:"redirectToHTTPS" json:"redirectToHTTPS"` // 自动跳转到HTTPS } `yaml:"http" json:"http"` Https struct { On bool `yaml:"on" json:"on"` Listen []string `yaml:"listen" json:"listen"` Cert string `yaml:"cert" json:"cert"` Key string `yaml:"key" json:"key"` } `yaml:"https" json:"https"` Env string `yaml:"env" json:"env"` // 环境,dev、test或prod Charset string `yaml:"charset" json:"charset"` // 字符集 Upload struct { MaxSize string `yaml:"maxSize" json:"maxSize"` // 允许上传的最大尺寸 // contains filtered or unexported fields } `yaml:"upload" json:"upload"` // 上传配置 Errors map[string]interface{} `yaml:"errors" json:"errors"` // 错误配置 }
ServerConfig 服务配置
func (*ServerConfig) Load ¶
func (this *ServerConfig) Load()
func (*ServerConfig) MaxSize ¶
func (this *ServerConfig) MaxSize() float64
type ServerRoutePattern ¶
type ServerRoutePattern struct {
// contains filtered or unexported fields
}
ServerRoutePattern 路由配置
type ServerStaticDir ¶
type ServerStaticDir struct {
// contains filtered or unexported fields
}
ServerStaticDir 静态资源目录
Directories ¶
Path | Synopsis |
---|---|
atom
Package atom provides integer codes (also known as atoms) for a fixed set of frequently occurring HTML strings: tag names and attribute keys such as "p" and "id".
|
Package atom provides integer codes (also known as atoms) for a fixed set of frequently occurring HTML strings: tag names and attribute keys such as "p" and "id". |
utils
|
|
Click to show internal directories.
Click to hide internal directories.