json

package
v0.0.0-...-ecab513 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Copyright 2021 Healthians.com. All rights reserved. Use of this source code is restricted to Expedient Healthcare Marketing Private Ltd. and/or its subsidiaries.

Package json contains JSON response functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(w http.ResponseWriter, r *http.Request, err error)

BadRequest sends a bad request error to the client.

func Created

func Created(w http.ResponseWriter, r *http.Request, body interface{})

Created sends a created response to the client.

func Forbidden

func Forbidden(w http.ResponseWriter, r *http.Request)

Forbidden sends a forbidden error to the client.

func NoContent

func NoContent(w http.ResponseWriter, r *http.Request)

NoContent sends a no content response to the client.

func NotFound

func NotFound(w http.ResponseWriter, r *http.Request)

NotFound sends a page not found error to the client.

func OK

func OK(w http.ResponseWriter, r *http.Request, body interface{})

OK creates a new JSON response with a 200 status code.

func ServerError

func ServerError(w http.ResponseWriter, r *http.Request, err error)

ServerError sends an internal error to the client.

func Unauthorized

func Unauthorized(w http.ResponseWriter, r *http.Request)

Unauthorized sends a not authorized error to the client.

Types

This section is empty.

Jump to

Keyboard shortcuts

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