Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(opts ...Option) gin.HandlerFunc
New wraps a handler and aborts the process of the handler if the timeout is reached
Types ¶
type BufferPool ¶
type BufferPool struct {
// contains filtered or unexported fields
}
BufferPool is Pool of *bytes.Buffer
func (*BufferPool) Put ¶
func (p *BufferPool) Put(buf *bytes.Buffer)
Put a bytes.Buffer pointer to BufferPool
type Writer ¶
type Writer struct {
gin.ResponseWriter
// contains filtered or unexported fields
}
Writer is a writer with memory buffer
func NewWriter ¶
func NewWriter(w gin.ResponseWriter, buf *bytes.Buffer) *Writer
NewWriter will return a timeout.Writer pointer
func (*Writer) Status ¶
Status we must implement this func, or the status code will always be 200 when call gin.Context.Writer.Status() in our custom gin middleware.
func (*Writer) WriteHeader ¶
WriteHeader will write http status code
func (*Writer) WriteHeaderNow ¶
func (w *Writer) WriteHeaderNow()
Click to show internal directories.
Click to hide internal directories.