rkzerointer

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package rkzerointer provides common utility functions for middleware of go-zero framework

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RkResponseWriter

type RkResponseWriter struct {
	Writer http.ResponseWriter
	Code   int
	Size   atomic.Int
}

A RkResponseWriter is a helper to delay sealing a http.ResponseWriter on writing code.

func WrapResponseWriter

func WrapResponseWriter(w http.ResponseWriter) *RkResponseWriter

WrapResponseWriter if current writer is not RkResponseWriter

func (*RkResponseWriter) Flush

func (w *RkResponseWriter) Flush()

Flush flushes the response writer.

func (*RkResponseWriter) Header

func (w *RkResponseWriter) Header() http.Header

Header returns the http header.

func (*RkResponseWriter) Hijack

func (w *RkResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)

Hijack implements the http.Hijacker interface. This expands the Response to fulfill http.Hijacker if the underlying http.ResponseWriter supports it.

func (*RkResponseWriter) Write

func (w *RkResponseWriter) Write(bytes []byte) (int, error)

Write writes bytes into w.

func (*RkResponseWriter) WriteHeader

func (w *RkResponseWriter) WriteHeader(code int)

WriteHeader writes code into w, and not sealing the writer.

Directories

Path Synopsis
Package rkzeroauth is auth middleware for go-zero framework
Package rkzeroauth is auth middleware for go-zero framework
Package rkzeroctx defines utility functions and variables used by go-zero middleware
Package rkzeroctx defines utility functions and variables used by go-zero middleware
Package rkzerocors is a CORS middleware for go-zero framework
Package rkzerocors is a CORS middleware for go-zero framework
Package rkzerocsrf is a middleware for go-zero framework which validating csrf token for RPC
Package rkzerocsrf is a middleware for go-zero framework which validating csrf token for RPC
Package rkzerojwt is a middleware for go-zero framework which validating jwt token for RPC
Package rkzerojwt is a middleware for go-zero framework which validating jwt token for RPC
Package rkzerolog is a middleware for go-zero framework for logging RPC.
Package rkzerolog is a middleware for go-zero framework for logging RPC.
Package rkzerometa is a middleware of go-zero framework for adding metadata in RPC response
Package rkzerometa is a middleware of go-zero framework for adding metadata in RPC response
Package rkzeropanic is a middleware of go-zero framework for recovering from panic
Package rkzeropanic is a middleware of go-zero framework for recovering from panic
Package rkzeroprom is a middleware for go-zero framework which record prometheus metrics for RPC
Package rkzeroprom is a middleware for go-zero framework which record prometheus metrics for RPC
Package rkzerolimit is a middleware of go-zero framework for adding rate limit in RPC response
Package rkzerolimit is a middleware of go-zero framework for adding rate limit in RPC response
Package rkzerosec is a middleware of go-zero framework for adding secure headers in RPC response
Package rkzerosec is a middleware of go-zero framework for adding secure headers in RPC response
Package rkzerotrace is aa middleware of go-zero framework for recording trace info of RPC
Package rkzerotrace is aa middleware of go-zero framework for recording trace info of RPC

Jump to

Keyboard shortcuts

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