utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeJSON

func DecodeJSON(r *http.Request, v interface{}) error

DecodeJSON decodes JSON request body into the provided struct

func RespondJSON

func RespondJSON(w http.ResponseWriter, r *http.Request, status int, payload interface{}) error

RespondJSON sends a JSON response with proper headers

func ValidateContentType

func ValidateContentType(r *http.Request, contentType string) bool

ValidateContentType checks if the request has the required content type

Types

This section is empty.

Directories

Path Synopsis
optional module
set module

Jump to

Keyboard shortcuts

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