bff

package
v0.0.0-...-bbc86cb Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeSuccess                 = 0
	CodeVersionError            = 1
	CodeUpdating                = 101
	CodeNotFound                = 1000
	CodeRequestUrlParamError    = 1001
	CodeRequestQueryParamError  = 1002
	CodeRequestCommonParamError = 1003
	CodeRequestBodyError        = 1004
	CodeNotLogin                = 1005
	CodeServerError             = 1006
	CodeNotAllow                = 1007
)

service inner error code list

Variables

This section is empty.

Functions

func CodeIter

func CodeIter(fn func(key int, value string) bool)

func Engine

func Engine() *gin.RouterGroup

func GetMessage

func GetMessage(code int) string

func HttpHandler

func HttpHandler(handler BbfHandler) gin.HandlerFunc

func Main

func Main() error

func MergeCodes

func MergeCodes(codes Codes)

请在初始化阶段使用该函数,运行时使用该函数可能导致同步问题

Types

type BbfHandler

type BbfHandler func(state *State)

type Codes

type Codes map[int]string

type State

type State struct {
	*neonx.Session
	logger.Logger
	Gin *gin.Context
	// contains filtered or unexported fields
}

func NewState

func NewState(ctx *gin.Context) *State

func (*State) BindJSON

func (m *State) BindJSON(v interface{}) error

func (*State) Context

func (m *State) Context() context.Context

func (*State) Error

func (m *State) Error(code int, err error)

func (*State) ShouldBindJSON

func (m *State) ShouldBindJSON(v interface{}) error

func (*State) Success

func (m *State) Success(v interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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