Documentation ¶
Index ¶
- func ExtractParam(r *http.Request) string
- func NewLoggingResponseWriter(w http.ResponseWriter) *xLogResponseWriter
- type LogWriter
- type OptLog
- func (opt *OptLog) WithCompany(company string) *OptLog
- func (opt *OptLog) WithIp(ip string) *OptLog
- func (opt *OptLog) WithMethod(method string) *OptLog
- func (opt *OptLog) WithOpTime(time string) *OptLog
- func (opt *OptLog) WithOpType(ty string) *OptLog
- func (opt *OptLog) WithParam(param string) *OptLog
- func (opt *OptLog) WithPermission(permission string) *OptLog
- func (opt *OptLog) WithRsp(ret Result) *OptLog
- func (opt *OptLog) WithUrl(url string) *OptLog
- func (opt *OptLog) WithUser(user string) *OptLog
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractParam ¶ added in v1.0.17
ExtractParam 从 http.Request 中提取参数
func NewLoggingResponseWriter ¶ added in v1.0.18
func NewLoggingResponseWriter(w http.ResponseWriter) *xLogResponseWriter
Types ¶
type OptLog ¶
type OptLog struct { User string `json:"user,omitempty"` OpTime string `json:"op_time,omitempty"` OpType string `json:"op_type,omitempty"` IP string `json:"ip,omitempty"` Company string `json:"company,omitempty"` Permission string `json:"permission,omitempty"` Method string `json:"method,omitempty"` URL string `json:"url,omitempty"` Module string `json:"module,omitempty"` Param string `json:"param,omitempty"` Trace string `json:"trace,omitempty"` CreatedAt string `json:"created_at,omitempty"` Result Result `json:"result,omitempty"` }
OptLog 定义了操作日志的结构
func (*OptLog) WithCompany ¶
func (*OptLog) WithMethod ¶
func (*OptLog) WithOpTime ¶
WithOpTime 为 OptLog 设置操作时间
func (*OptLog) WithOpType ¶
func (*OptLog) WithPermission ¶
Click to show internal directories.
Click to hide internal directories.