isuhttp

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KB float64 = 1 << (10 * (iota + 1))
	MB
	GB
	TB
)

Variables

View Source
var FilterFunc = func(path string) string {
	newPath, ok := func() (string, bool) {
		filterCacheLocker.RLock()
		defer filterCacheLocker.RUnlock()

		if v, ok := filterCache[path]; ok {
			return v, true
		}

		return "", false
	}()
	if ok {
		return newPath
	}

	for _, re := range filterReList {
		path = re.re.ReplaceAllString(path, re.to)
	}

	return path
}

Functions

func ClientSetting

func ClientSetting(client *http.Client)

func EchoMetricsMiddleware

func EchoMetricsMiddleware(next echo.HandlerFunc) echo.HandlerFunc

func EchoSetting

func EchoSetting(e *echo.Echo) *echo.Echo

func FastListenAndServe

func FastListenAndServe(addr string, handler fasthttp.RequestHandler) error

func FastListenAndServeTLS

func FastListenAndServeTLS(addr, certFile, keyFile string, handler fasthttp.RequestHandler) error

func FastListenAndServeTLSEmbed

func FastListenAndServeTLSEmbed(addr string, certData, keyData []byte, handler fasthttp.RequestHandler) error

func FastMetricsMiddleware

func FastMetricsMiddleware(next fasthttp.RequestHandler) fasthttp.RequestHandler

func FastServerListenAndServe

func FastServerListenAndServe(server *fasthttp.Server, addr string) error

func FastServerListenAndServeTLS

func FastServerListenAndServeTLS(server *fasthttp.Server, addr string, certFile, keyFile string) error

func FastServerListenAndServeTLSEmbed

func FastServerListenAndServeTLSEmbed(server *fasthttp.Server, addr string, certData, keyData []byte) error

func FiberMetricsMiddleware

func FiberMetricsMiddleware(next fiber.Handler) fiber.Handler

func FiberNew

func FiberNew(conf ...fiber.Config) *fiber.App

func GinMetricsMiddleware

func GinMetricsMiddleware(c *gin.Context)

func GinNew

func GinNew(engine *gin.Engine) *gin.Engine

func GinRun

func GinRun(engine *gin.Engine, addrs ...string) error

func GinRunTLS

func GinRunTLS(engine *gin.Engine, addr, certFile, keyFile string) error

func ListenAndServe

func ListenAndServe(addr string, handler http.Handler) error

func ListenAndServeTLS

func ListenAndServeTLS(addr, certFile, keyFile string, handler http.Handler) error

func ServerListenAndServe

func ServerListenAndServe(server *http.Server) error

func ServerListenAndServeTLS

func ServerListenAndServeTLS(server *http.Server, certFile, keyFile string) error

func ServerMuxHandle

func ServerMuxHandle(mux *http.ServeMux, pattern string, handler http.Handler)

func ServerMuxHandleFunc

func ServerMuxHandleFunc(mux *http.ServeMux, pattern string, handler func(http.ResponseWriter, *http.Request))

func SetPath

func SetPath(req *http.Request, path string)

func SetUnix

func SetUnix(path string)

func StdMetricsMiddleware

func StdMetricsMiddleware(next http.Handler) http.Handler

Types

type JSONSerializer

type JSONSerializer struct{}

func (JSONSerializer) Deserialize

func (JSONSerializer) Deserialize(c echo.Context, i any) error

func (JSONSerializer) Serialize

func (JSONSerializer) Serialize(c echo.Context, i any, indent string) error

Directories

Path Synopsis
internal
generate
Code generated by iwrapper; DO NOT EDIT.
Code generated by iwrapper; DO NOT EDIT.

Jump to

Keyboard shortcuts

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