utils

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorResponse

func ErrorResponse(w http.ResponseWriter, err error)

func JSONResponse

func JSONResponse(w http.ResponseWriter, result interface{})

func StatusResponse

func StatusResponse(w http.ResponseWriter, status *models.Status)

func WriteResponse

func WriteResponse(w http.ResponseWriter, statusCode int, response ...string)

Types

type RadixMiddleware

type RadixMiddleware struct {
	// contains filtered or unexported fields
}

RadixMiddleware The middleware between router and radix handler functions

func NewRadixMiddleware

func NewRadixMiddleware(path, method string, handler models.RadixHandlerFunc) *RadixMiddleware

func (*RadixMiddleware) Handle

func (mw *RadixMiddleware) Handle(w http.ResponseWriter, r *http.Request)

Handle Wraps radix handler methods

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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