ctx

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Use

func Use(e ICtx) gin.HandlerFunc

Types

type Flow

type Flow struct {
	// contains filtered or unexported fields
}

func (*Flow) CloseColor added in v0.8.0

func (f *Flow) CloseColor()

func (*Flow) FlowHandle added in v0.7.0

func (f *Flow) FlowHandle() *replyx.T

func (*Flow) FlowLogic added in v0.7.0

func (f *Flow) FlowLogic() *replyx.T

func (*Flow) FlowValidate added in v0.7.0

func (f *Flow) FlowValidate() *replyx.T

func (*Flow) GetAuthor added in v0.5.7

func (f *Flow) GetAuthor() string

func (*Flow) GetCtx added in v0.7.1

func (f *Flow) GetCtx() *gin.Context

func (*Flow) GetReq added in v0.7.0

func (f *Flow) GetReq() interface{}

func (*Flow) LogErrorf added in v0.7.8

func (f *Flow) LogErrorf(format string, a ...interface{})

func (*Flow) LogInfof added in v0.7.8

func (f *Flow) LogInfof(format string, a ...interface{})

func (*Flow) ReturnJson

func (f *Flow) ReturnJson(data *replyx.T)

func (*Flow) ReturnSucc added in v0.7.0

func (f *Flow) ReturnSucc(data interface{})

func (*Flow) SetHttpCode added in v0.7.0

func (f *Flow) SetHttpCode(code int)

func (*Flow) SetReq added in v0.7.0

func (f *Flow) SetReq(obj interface{})

func (*Flow) ShouldBind added in v0.7.0

func (f *Flow) ShouldBind(obj interface{}) error

func (*Flow) ShouldBindJSON added in v0.7.0

func (f *Flow) ShouldBindJSON(obj interface{}) error

type ICtx added in v0.5.7

type ICtx interface {
	GetAuthor() string                            // 获取作者
	SetHttpCode(code int)                         // 设置 http code
	ReturnJson(data *replyx.T)                    // 返回 json
	ReturnSucc(obj interface{})                   // 返回成功
	LogErrorf(format string, args ...interface{}) // 打印错误日志
	LogInfof(format string, args ...interface{})  // 打印信息日志
	ShouldBind(obj interface{}) error             // 绑定form
	ShouldBindJSON(obj interface{}) error         // 绑定json
	GetCtx() *gin.Context                         // 获取 gin 上下文
	SetReq(obj interface{})                       // 绑定请求参数
	GetReq() interface{}                          // 获取请求参数
	CloseColor()                                  // 关闭颜色

	FlowHandle() *replyx.T   // 业务逻辑-控制器句柄
	FlowValidate() *replyx.T // 业务逻辑-参数校验
	FlowLogic() *replyx.T    // 业务逻辑-业务逻辑
	// contains filtered or unexported methods
}

type Level added in v0.7.0

type Level string
const (
	DebugLevel Level = "debug"
	InfoLevel  Level = "info"
	WarnLevel  Level = "warn"
	ErrorLevel Level = "error"
	PanicLevel Level = "panic"
	FatalLevel Level = "fatal"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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