chix

package
v0.0.0-...-4122671 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(router *chi.Mux, pattern string, handler Handler, middlewares ...func(http.Handler) http.Handler)

func Get

func Get(router *chi.Mux, pattern string, handler Handler, middlewares ...func(http.Handler) http.Handler)

func Patch

func Patch(router *chi.Mux, pattern string, handler Handler, middlewares ...func(http.Handler) http.Handler)

func Post

func Post(router *chi.Mux, pattern string, handler Handler, middlewares ...func(http.Handler) http.Handler)

func Put

func Put(router *chi.Mux, pattern string, handler Handler, middlewares ...func(http.Handler) http.Handler)

Types

type ErrorResponse

type ErrorResponse struct {
	Error any `json:"error"`
}

type Handler

type Handler func(*http.Request) Response

type MessageResponse

type MessageResponse struct {
	Message string `json:"message"`
}

type Response

type Response struct {
	StatusCode int
	Body       any
}

func BadRequest

func BadRequest(body any) Response

func Conflict

func Conflict(body any) Response

func Created

func Created(body any) Response

func Forbidden

func Forbidden(body any) Response

func InternalServerError

func InternalServerError() Response

func MethodNotAllowed

func MethodNotAllowed() Response

func NoContent

func NoContent() Response

func NotFound

func NotFound(body any) Response

func OK

func OK(body any) Response

func Unauthorized

func Unauthorized(body any) Response

Jump to

Keyboard shortcuts

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