handlerfunc

package
v1.4.60 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

handlerfunc

Commonly used public handlers.


Example of use

	r := gin.New()
	r.GET("/health", handlerfunc.CheckHealth)
	r.GET("/ping", handlerfunc.Ping)

Documentation

Overview

Package handlerfunc is used for public http request handler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BrowserRefresh

func BrowserRefresh(path string) func(c *gin.Context)

BrowserRefresh solve vue using history route 404 problem, for system file

func BrowserRefreshFS

func BrowserRefreshFS(fs embed.FS, path string) func(c *gin.Context)

BrowserRefreshFS solve vue using history route 404 problem, for embed.FS

func CheckHealth

func CheckHealth(c *gin.Context)

CheckHealth check healthy. @Summary check health @Description check health @Tags system @Accept json @Produce json @Success 200 {object} CheckHealthReply{} @Router /health [get]

func ListCodes

func ListCodes(c *gin.Context)

ListCodes list error codes info @Summary list error codes info @Description list error codes info @Tags system @Accept json @Produce json @Router /codes [get]

func Ping

func Ping(c *gin.Context)

Ping ping @Summary ping @Description ping @Tags system @Accept json @Produce json @Router /ping [get]

Types

type CheckHealthReply

type CheckHealthReply struct {
	Status   string `json:"status"`
	Hostname string `json:"hostname"`
}

CheckHealthReply check health result

Jump to

Keyboard shortcuts

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