http_response

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetErrorMessage

func GetErrorMessage(err error) string

func GetErrorStatus

func GetErrorStatus(err error) int

func NewCustomError

func NewCustomError(statusCode int, message string) *customError

func NewResponseHTTP

func NewResponseHTTP(statusCode int, payload interface{}) *responseHttp

Types

type CustomError

type CustomError interface {
	DefaultLogResponse()
}

type ResponseHTTP

type ResponseHTTP interface {
	ResponseJSON(rw http.ResponseWriter, resp *responseHttp)
	ErrorJSON(rw http.ResponseWriter, ce customError)
}

Jump to

Keyboard shortcuts

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