httputil

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteErrorResponseWithLog

func WriteErrorResponseWithLog(rw http.ResponseWriter, status int, msg, endpoint string, logger log.Logger)

WriteErrorResponseWithLog write error response along with adding a error log.

func WriteResponseWithLog

func WriteResponseWithLog(rw io.Writer, v interface{}, endpoint string, logger log.Logger)

WriteResponseWithLog writes interface value to response along with adding a info log.

Types

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"errMessage,omitempty"`
}

ErrorResponse to send error message in the response.

Jump to

Keyboard shortcuts

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