handler

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 2 more Imports: 9 Imported by: 1

Documentation

Overview

Package handler comes from admin/admin.go of trpc-go you can add this handler to your http(s) server

Index

Constants

View Source
const PattenLoglevel = "/cmds/loglevel"

PattenLoglevel View/Set the log level of the framework

Variables

View Source
var (
	ReturnErrCodeParam = "errorcode"
	ReturnMessageParam = "message"
	ErrCodeServer      = 1
)

return param.

Functions

func ErrorOutput

func ErrorOutput(w http.ResponseWriter, error string, code int)

ErrorOutput Unified error output.

func GinLogger

func GinLogger() gin.HandlerFunc

GinLogger forked from github.com/toorop/gin-logrus

func RegisterHandler

func RegisterHandler(r *http.ServeMux)

func RegisterHandlerWithPath

func RegisterHandlerWithPath(r *http.ServeMux, path string)

Types

type LevelHandler

type LevelHandler struct{}

func (LevelHandler) ServeHTTP

func (h LevelHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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