web

package
v1.15.8 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: MIT Imports: 48 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// GzipMinSize represents min size to compress for the body size of response
	GzipMinSize = 1400
)

Variables

This section is empty.

Functions

func CorsHandler

func CorsHandler() func(next http.Handler) http.Handler

CorsHandler return a http handler who set CORS options if enabled by config

func Home

func Home(ctx *context.Context)

Home render home page

func Metrics

func Metrics(resp http.ResponseWriter, req *http.Request)

Metrics validate auth token and render prometheus metrics

func NotFound

func NotFound(ctx *context.Context)

NotFound render 404 page

func Recovery

func Recovery() func(next http.Handler) http.Handler

Recovery returns a middleware that recovers from any panics and writes a 500 and a log if so. This error will be created with the gitea 500 page.

func RegisterRoutes

func RegisterRoutes(m *web.Route)

RegisterRoutes register routes

func Routes

func Routes() *web.Route

Routes returns all web routes

func SwaggerV1Json

func SwaggerV1Json(ctx *context.Context)

SwaggerV1Json render swagger v1 json

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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