jsonWriter

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: GPL-3.0 Imports: 2 Imported by: 1

README

jsonWriter

This Go Package writes a response in json format to the Responsewriter (interface)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(w http.ResponseWriter, ErrorMessage string, ErrorCode int)

Writes Error Message to ResponseWriter in json format Similar to http.Error(w ResponseWriter, error string, code int) Example of json written is --> {"error":ErrorMessage}

func Response

func Response(w http.ResponseWriter, Title string, Message string, StatusCode int)

Writes a Response Message to ResponseWriter in json format Similar to http.Write(string) Example of json written is --> {"title": Title, "message":Message}

Types

This section is empty.

Jump to

Keyboard shortcuts

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