types

package
Version: v0.0.0-...-9b971e3 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XContext = "x-context" // context的key
	XTraceid = "x-traceid" // traceid的key
	XUserid  = "x-userid"  // userid的key
	XOnce    = "x-once"    // once的key
	XData    = "x-data"    // data的key
)
View Source
const (
	ACCESS = "access" // 访问日志
	DATA   = "data"   // 数据变更
	CODE   = "code"   // 代码跟踪
	SQL    = "sql"    // SQL语句
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CtxKey

type CtxKey string

type KV

type KV struct {
	Key   string
	Value interface{}
}

type LogAccessReq

type LogAccessReq struct {
	ClientIP string `json:"client_ip"`
	Method   string `json:"method"`
	Path     string `json:"path"`
	Agent    string `json:"agent"`
}

记录的请求内容

type LogAccessResp

type LogAccessResp struct {
	StatusCode int    `json:"status_code"`
	BodySize   int    `json:"body_size"`
	ExecTime   string `json:"exec_time"`
}

记录的响应内容

type LogData

type LogData struct {
	Source interface{} `json:"source"`
	Dist   interface{} `json:"dist"`
}

记录的数据变更内容

type LogSQL

type LogSQL struct {
	SQL    string      `json:"sql"`
	Params interface{} `json:"params"`
}

记录SQL

type ReqBaseModel

type ReqBaseModel struct {
	Hash  string `json:"hash" binding:"required"`
	Once  string `json:"once" binding:"required"`
	Token string `json:"token"`
	Data  string `json:"data"`
}

请求数据格式

type ReqPageModel

type ReqPageModel struct {
	PageNo   int `json:"pageNo,omitempty"`
	PageSize int `json:"pageSize,omitempty"`
}

基础model

type RespPageModel

type RespPageModel struct {
	Total int         `json:"total"`
	List  interface{} `json:"list"`
}

包装分页返回对象

Jump to

Keyboard shortcuts

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