response

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResponseMiddleware

func ResponseMiddleware() gin.HandlerFunc

ResponseMiddleware return a gin.HandlerFunc. The code after next takes effect in the reverse order. So must register this middleware before use BodyWriter.

Types

type BodyWriter

type BodyWriter struct {
	gin.ResponseWriter
	Body *bytes.Buffer
}

BodyWriter inherit the ResponseWriter of Gin and add the body field to expose the response

func (BodyWriter) Write

func (w BodyWriter) Write(b []byte) (int, error)

Write for writing responses body

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳