Back to godoc.org

Package ginutils

v0.0.0-...-4d7de85
Latest Go to latest

The latest major version is .

Published: 5 days ago | License: Apache-2.0 | Module: github.com/banzaicloud/pipeline

Index

func Context

func Context(ctx context.Context, c *gin.Context) context.Context

Context returns a new Go context from a Gin context.

func GetRequiredHeader

func GetRequiredHeader(ctx *gin.Context, headerName string) (string, bool)

GetRequiredHeader returns a header value or responds with an error.

func ParamsToMap

func ParamsToMap(params gin.Params) map[string]string

ParamsToMap converts a Gin parameter list to a simple string map.

func ReplyWithErrorResponse

func ReplyWithErrorResponse(ctx *gin.Context, errorResponse *common.ErrorResponse)

ReplyWithErrorResponse replies with an error response.

func RequiredHeaderMissingErrorResponse

func RequiredHeaderMissingErrorResponse(headerName string) *common.ErrorResponse

RequiredHeaderMissingErrorResponse creates a common.ErrorResponse denoting missing required header.

func RequiredQueryMissingErrorResponse

func RequiredQueryMissingErrorResponse(queryName string) *common.ErrorResponse

RequiredQueryMissingErrorResponse creates a common.ErrorResponse denoting missing required header.

func RequiredQueryOrAbort

func RequiredQueryOrAbort(ctx *gin.Context, queryName string) (string, bool)

RequiredQueryOrAbort returns a query value or responds with an error.

func UintParam

func UintParam(ctx *gin.Context, paramName string) (uint, bool)

UintParam returns a parameter parsed as uint or responds with an error.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier