utils

package
v0.0.0-...-4d27c10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendBadParamError

func SendBadParamError(w http.ResponseWriter, p []ParamError)

func SendGenericError

func SendGenericError(w http.ResponseWriter, code int, msg string)

func SendOKResponse

func SendOKResponse(w http.ResponseWriter, b interface{})

func SendResponse

func SendResponse(w http.ResponseWriter, code int, b interface{})

Types

type BadParamError

type BadParamError struct {
	Fields    []ParamError `json:"fields"`
	ErrorCode int          `json:"errorCode"`
}

type ErrorResponse

type ErrorResponse struct {
	Message   string `json:"message"`
	ErrorCode int    `json:"errorCode"`
}

type ParamError

type ParamError struct {
	Param   string `json:"param"`
	Message string `json:"message"`
	Type    string `json:"type"`
}

func Validator

func Validator(s interface{}) []ParamError

Jump to

Keyboard shortcuts

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