mdws

package
v2.10.18 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GinLogger added in v2.10.5

func GinLogger(suffix string, identityKey string) gin.HandlerFunc

func GinRateLimit added in v2.3.6

func GinRateLimit(switchName, rateName string) gin.HandlerFunc

func GinRecovery

func GinRecovery() gin.HandlerFunc

Types

type LogFormatterParams added in v2.10.5

type LogFormatterParams struct {
	// StatusCode is HTTP response code.
	StatusCode int
	// Latency is how much time the server cost to process a certain request.
	Latency time.Duration
	// ClientIP equals Context's ClientIP method.
	ClientIP string
	// Method is the HTTP method given to the request.
	Method string
	// Path is a path the client requests.
	Path string
	// ErrorMessage is set if error has occurred in processing the request.
	ErrorMessage string
	// BodySize is the size of the Response Body
	BodySize int
	//userId
	UserId int64
}

type RateLimiter added in v2.3.6

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

func NewRateLimiter added in v2.3.6

func NewRateLimiter(switchName, rateName string) *RateLimiter

func (*RateLimiter) Take added in v2.3.6

func (r *RateLimiter) Take() (bool, int, time.Duration)

type ReqLogger added in v2.10.5

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

func NewReqLogger added in v2.10.5

func NewReqLogger(suffix string, identityKey string) *ReqLogger

func (*ReqLogger) Record added in v2.10.5

func (r *ReqLogger) Record(item LogFormatterParams)

Jump to

Keyboard shortcuts

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