Documentation ¶
Index ¶
- Constants
- func AddRequestLogExtra(r *http.Request, name string, val interface{})
- func FlushErr(w http.ResponseWriter, r *http.Request, err error)
- func GenerateReqId(r *http.Request) string
- func JsonBody(r *http.Request) (st *base.Struct, err error)
- func JsonBodyTo(r *http.Request, v interface{}) error
- func ListenAndServe(serveAt string, r *rrouter.Router) error
- func Middleware_gzip(handler http.Handler) http.Handler
- func Middleware_httpRequestLog(handler http.Handler) http.Handler
- func Middleware_panicLog(handle http.HandlerFunc) http.HandlerFunc
- type ClientConfig
- type RenderConfig
- type Resp
- type RespErr
- type ServerConfig
Constants ¶
View Source
const (
RequestIdKey = "*req*"
)
Variables ¶
This section is empty.
Functions ¶
func AddRequestLogExtra ¶
在request的log中添加extra信息
func GenerateReqId ¶
func JsonBodyTo ¶
func Middleware_panicLog ¶
func Middleware_panicLog(handle http.HandlerFunc) http.HandlerFunc
Types ¶
type ClientConfig ¶
type ClientConfig struct {
BaseUrl string `yml:"baseUrl"`
}
type RenderConfig ¶
type Resp ¶
type RespErr ¶
func NewRespErr ¶
type ServerConfig ¶
type ServerConfig struct { Render *RenderConfig `yml:"render"` ReadTimeoutMs int64 `yml:"readtimeoutMs"` WriteTimeoutMs int64 `yml:"writetimeoutMs"` Middlewares []string `yml:"middlewares"` }
Click to show internal directories.
Click to hide internal directories.