httpencoder

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorEncoder

func ErrorEncoder(w nethttp.ResponseWriter, r *nethttp.Request, err error)

ErrorEncoder encode error response

func ResponseEncoder

func ResponseEncoder(w http.ResponseWriter, r *http.Request, data interface{}) error

ResponseEncoder encode response struct

Types

type Response

type Response struct {
	Code    int         `json:"code"`
	Success bool        `json:"success"`
	Data    interface{} `json:"data"`
	Message string      `json:"message"`
}

Jump to

Keyboard shortcuts

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