utils

package
v0.0.0-...-3d0862d Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResponseErrWrongBodyFormat string = "Wrong body format"
	ResponseErrWrongData       string = "Wrong data"
	ResponseOK                 string = "ok"
	ResponseSuccess            string = "success"
)

Variables

This section is empty.

Functions

func CheckError

func CheckError(err error, message string)

func CheckQuery

func CheckQuery(r *http.Request, value string, regExp string) error

func PrepareAmountValue

func PrepareAmountValue(amount float64) (float64, error)

func ResponseWriter

func ResponseWriter(w http.ResponseWriter, statusCode int, message string, data interface{})

Types

type JsonResponse

type JsonResponse struct {
	Status  int         `json:"status"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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