gin

package
v0.0.0-...-3d5bf6e Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFlag

func AddFlag(fs *flag.FlagSet)

func DefaultServer

func DefaultServer(conf *config.ServerConfig) *gin.Engine

func NewServer

func NewServer() *gin.Engine

func ServerReqMetric

func ServerReqMetric() gin.HandlerFunc

func Shutdown

func Shutdown(engine *gin.Engine, ctx context.Context) error

func Start

func Start(engine *gin.Engine)

Types

type JSON

type JSON struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	TTL     int         `json:"ttl"`
	Data    interface{} `json:"data,omitempty"`
}

func TOJSON

func TOJSON(resp interface{}, err error) (data JSON)

type RateLimiter

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

RateLimiter bbr middleware.

func NewRateLimiter

func NewRateLimiter(conf *bbr.Config) (s *RateLimiter)

NewRateLimiter return a ratelimit middleware.

func (*RateLimiter) Limit

func (b *RateLimiter) Limit() gin.HandlerFunc

Limit return a bm handler func.

Jump to

Keyboard shortcuts

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