ginshared

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 18 Imported by: 4

Documentation

Index

Constants

View Source
const (
	KeyAddress = "address"
	KeyInitDB  = "database.initDB"
)

Variables

View Source
var ControllerOptions = dig.Group("controllers")

Functions

func CloneRequestBody added in v0.1.14

func CloneRequestBody(c *gin.Context) []byte

func DropDuplicated added in v0.1.10

func DropDuplicated(raw []string) []string

func GetContainer

func GetContainer() *dig.Container

func MD5 added in v0.1.14

func MD5(raw []byte) string

func NewErrorReport added in v0.1.1

func NewErrorReport(replyCode int, logger *zap.Logger) gin.HandlerFunc

func Provide added in v0.2.0

func Provide(constructor interface{}, opts ...dig.ProvideOption) error

func ProvideController added in v0.2.0

func ProvideController(constructor interface{}) error

func ReportBadrequest added in v0.1.2

func ReportBadrequest(c *gin.Context, err error)

func Start

func Start() error

Types

type DiController

type DiController interface{}

type ErrorCode added in v0.1.1

type ErrorCode interface {
	ErrorCode() string
}

type GeneralResp added in v0.1.1

type GeneralResp struct {
	Succ         bool
	ErrorCode    string
	ErrorMessage string
}

type Params

type Params struct {
	dig.In
	Logger      *zap.Logger
	Router      *gin.Engine
	Controllers []DiController `group:"controllers"`
}

type ReportError added in v0.1.1

type ReportError struct {
	ReplyCode int
	// contains filtered or unexported fields
}

func (*ReportError) Middleware added in v0.1.1

func (handle *ReportError) Middleware(c *gin.Context)

func (*ReportError) RespErrorToClient added in v0.1.1

func (handle *ReportError) RespErrorToClient(c *gin.Context, err interface{})

Jump to

Keyboard shortcuts

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