httpx

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInternalServer = errors.New("internal server errror")
	ErrDecodeJsonBody = errors.New("error decode json body")
)

Functions

func GetBody

func GetBody(r *http.Request, v any) error

func Send

func Send(w http.ResponseWriter, res any, status int)

func SendData

func SendData(w http.ResponseWriter, data interface{}, status int)

func SendError

func SendError(w http.ResponseWriter, err error, status int)

func SendMessage

func SendMessage(w http.ResponseWriter, message string, status int)

Types

type DataJsonResponse

type DataJsonResponse struct {
	Data interface{} `json:"data"`
}

type ErrorJsonResponse

type ErrorJsonResponse struct {
	Error string `json:"error"`
}

type MessageJsonResponse

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

Jump to

Keyboard shortcuts

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