goContext

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

*

  • @Time : 2021/1/5 5:09 下午
  • @Author : MassAdobe
  • @Description: context

*

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handle

func Handle(handle HandlerFunc) gin.HandlerFunc

*

  • @Author: MassAdobe
  • @TIME: 2021/1/6 10:03 上午
  • @Description: 处理日志与gin框架合并 处理超时问题

*

Types

type Context

type Context struct {
	GinContext *gin.Context
	GinLog     *logs.MyLog
}

*

  • @Author: MassAdobe
  • @TIME: 2021/1/7 5:29 下午
  • @Description: 自适应context

*

func (*Context) Debug

func (this *Context) Debug(msg string, fields ...zap.Field)

*

  • @Author: MassAdobe
  • @TIME: 2020/12/17 7:52 下午
  • @Description: 重写Debug日志级别输出

*

func (*Context) Error

func (this *Context) Error(msg string, err error, fields ...zap.Field)

*

  • @Author: MassAdobe
  • @TIME: 2020/12/17 7:52 下午
  • @Description: 重写Error日志级别输出

*

func (*Context) FailRes added in v1.3.2

func (this *Context) FailRes(errCode int, data interface{})

*

  • @Author: MassAdobe
  • @TIME: 2020-04-26 21:12
  • @Description: 错误时返回 支持data为空

*

func (*Context) GetRequestUser added in v1.3.2

func (this *Context) GetRequestUser() *pojo.RequestUser

*

  • @Author: MassAdobe
  • @TIME: 2020-04-28 10:21
  • @Description: 获取用户基本信息

*

func (*Context) Info

func (this *Context) Info(msg string, fields ...zap.Field)

*

  • @Author: MassAdobe
  • @TIME: 2020/12/17 7:52 下午
  • @Description: 重写Info日志级别输出

*

func (*Context) SuccRes added in v1.3.2

func (this *Context) SuccRes(data interface{})

*

  • @Author: MassAdobe
  • @TIME: 2020-04-26 21:12
  • @Description: 成功时返回 支持data为空

*

func (*Context) SuccResFeign added in v1.3.2

func (this *Context) SuccResFeign(data interface{})

*

  • @Author: MassAdobe
  • @TIME: 2020/12/18 6:19 下午
  • @Description: 内部调用 成功时返回 支持data为空

*

func (*Context) SysDebug added in v1.3.5

func (this *Context) SysDebug(msg string, fields ...zap.Field)

*

  • @Author: MassAdobe
  • @TIME: 2020/12/17 7:52 下午
  • @Description: 重写Debug日志级别输出(系统)

*

func (*Context) SysError added in v1.3.2

func (this *Context) SysError(msg string, err error, fields ...zap.Field)

*

  • @Author: MassAdobe
  • @TIME: 2020/12/17 7:52 下午
  • @Description: 重写Error日志级别输出(系统)

*

func (*Context) SysInfo added in v1.3.2

func (this *Context) SysInfo(msg string, fields ...zap.Field)

*

  • @Author: MassAdobe
  • @TIME: 2021/1/7 11:59 上午
  • @Description: 重写Info日志级别输出(系统)

*

func (*Context) Warn

func (this *Context) Warn(msg string, fields ...zap.Field)

*

  • @Author: MassAdobe
  • @TIME: 2020/12/17 7:52 下午
  • @Description: 重写Warn日志级别输出

*

type HandlerFunc

type HandlerFunc func(c *Context)

*

  • @Author: MassAdobe
  • @TIME: 2021/1/7 5:29 下午
  • @Description: 嵌套方法体

*

type Response added in v1.3.2

type Response struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

*

  • @Author: MassAdobe
  • @TIME: 2020-04-26 21:12
  • @Description: 通用返回结构体封账

*

Jump to

Keyboard shortcuts

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