request

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OffsetRequestParameterName name of the offset parameter in a request.
	OffsetRequestParameterName = "offset"

	// LimitRequestParameterName name of the limit parameter in a request.
	LimitRequestParameterName = "limit"
)

Variables

This section is empty.

Functions

func DecodeBody

func DecodeBody(c *gin.Context, v interface{})

DecodeBody : decodes the JSON-formatted body of a request to a struct.

func GetLocaleValueFromRequest

func GetLocaleValueFromRequest(c *gin.Context, parameterName, errorMessageKey string) (string, bool)

GetLocaleValueFromRequest : extracts the locale from the URL.

func GetOffsetAndLimitFromRequest

func GetOffsetAndLimitFromRequest(c *gin.Context, defaultOffset, defaultLimit, maxLimit int) (bool, int, int)

GetOffsetAndLimitFromRequest : extracts the offset and limit from the GET parameters.

func GetUploadedFile

func GetUploadedFile(c *gin.Context, fieldName string, maxSize int64, checkIsImage bool, logContext, errorMessageKey string) *multipart.FileHeader

GetUploadedFile : returns the uploaded file.

func SaveUploadedFile

func SaveUploadedFile(c *gin.Context, file *multipart.FileHeader, destination, logContext, errorMessageKey string) bool

SaveUploadedFile : saves the uploaded file to the destination.

func Unescape

func Unescape(s string) string

Unescape : unescapes a string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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