logfunc

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package logfunc 提供一组预定义的 webapi.LogFunc ,以便快速实现 webapi.ApiLogger

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(state *webapi.ApiState)

Error 根据当前的错误信息,判断错误的级别,并输出错误的描述信息。

输出字段为: ErrorType/Error 。

func Files

func Files(state *webapi.ApiState)

Files 输出 [http.Request.MultipartForm] 中的文件概要信息。 该字段需要先通过 [http.Request.ParseMultipartForm] 初始化。

以此输出每个文件的(X 是文件的索引):

  • FileX 文件名。
  • LengthX 文件长度。
  • ContentTypeX 文件的 Content-Type 。

不会输出非文件的部分。

func IP

func IP(state *webapi.ApiState)

IP 输出发起 HTTP 请求的客户端 IP 地址。

输出字段为: IP 。

func URL

func URL(state *webapi.ApiState)

URL 输出请求的完整 URL 。

输出字段为: URL 。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL