http

package
v0.0.0-...-2ccb8c0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetJSON

func GetJSON(url string, target interface{}) error

GetJSON parse http response from the given url to targeted struct Returned response must be in json format

func Render

func Render(w http.ResponseWriter, response interface{}, cache int, callback string)

Render render http response with cache (in minutes) and callback param if exist

func RenderHTTPCode

func RenderHTTPCode(w http.ResponseWriter, message string, code int)

RenderHTTPCode middle to write http header code to header

func RenderHTTPJSON

func RenderHTTPJSON(w http.ResponseWriter, data interface{}, code int, callback string)

RenderHTTPJSON middleware to write json to http

func RenderHTTPText

func RenderHTTPText(w http.ResponseWriter, message string, code int)

RenderHTTPText middleware to write plain text to http

func RenderHTTPTextWithHeader

func RenderHTTPTextWithHeader(w http.ResponseWriter, message string, code int, additionalHeader map[string]string)

RenderHTTPTextWithHeader middleware to write plain text to http

Types

This section is empty.

Jump to

Keyboard shortcuts

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