io

package
v0.0.0-...-c53624e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadInput

func ReadInput(r *http.Request, logger *zerolog.Logger, value interface{}) error

ReadInput reads the JSON-encoded value from request and stores it in the value pointed to by value.

func WriteErrorMsg

func WriteErrorMsg(w http.ResponseWriter, logger *zerolog.Logger, statusCode int, message string)

WriteErrorMsg writes an error message to the http.ResponseWriter

func WriteSuccess

func WriteSuccess(w http.ResponseWriter, logger *zerolog.Logger, statusCode int, result interface{})

WriteSuccess writes a success result to the http.ResponseWriter

Types

type ErrorOutput

type ErrorOutput struct {
	Code    int    `json:"code"`
	Message string `json:"message" example:"something wrong happened"`
}

ErrorOutput represents the output data in case of error.

Jump to

Keyboard shortcuts

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