mygin

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindArgs

func BindArgs(c *gin.Context, arg interface{}) bool

func BindHeader

func BindHeader(c *gin.Context, arg interface{}) bool

func BindJsonArgs

func BindJsonArgs(c *gin.Context, arg interface{}) bool

func BindQueryArgs

func BindQueryArgs(c *gin.Context, arg interface{}) bool

func DecodeUrlVal

func DecodeUrlVal(c *gin.Context, key string) (string, bool)

func ErrInterrupt

func ErrInterrupt(c *gin.Context, err errcode.IErr)

func HasErr

func HasErr(c *gin.Context, errs ...error) bool

func PkgMsgWrite

func PkgMsgWrite(c *gin.Context, data interface{})

func RateMiddleware

func RateMiddleware(rateTime time.Duration) gin.HandlerFunc

Types

type Option

type Option struct {
	ListenIp     string // 监听IP
	Port         int    // 监听端口
	Mode         string
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
	CloseTimeout time.Duration
	RateTime     time.Duration
	Logger       gin.HandlerFunc

	Handler func(engine *gin.Engine) error
}

type Server

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

func NewServer

func NewServer(opfs ...func(opt *Option)) *Server

func NewServerWithConfig

func NewServerWithConfig(opt *Option) *Server

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

Jump to

Keyboard shortcuts

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