req

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplicationJson = "application/json"
	OnBehalfOf      = "OnBehalfOf"
)
View Source
const MaxQueryLimit = 5000

Variables

This section is empty.

Functions

func AddClient

func AddClient(id string, caCert string, clientCert string, clientKey string)

func BindParamsFromBody

func BindParamsFromBody(c *gin.Context, obj any) (err error)

func BindParamsFromQuery

func BindParamsFromQuery(c *gin.Context, obj any) (err error)

func BuildResponse

func BuildResponse(res *http.Response, err error, output any) error

func DoDelete

func DoDelete(client *http.Client, url string, params any, output any, token string) error

func DoDeleteBehalfOf

func DoDeleteBehalfOf(client *http.Client, url string, params any, output any, token string, onBehalfOf string) error

func DoGet

func DoGet(client *http.Client, url string, output any, token string) error

func DoGetOnBehalfOf

func DoGetOnBehalfOf(client *http.Client, url string, output any, token string, onBehalfOf string) error

func DoPost

func DoPost(client *http.Client, url string, params any, output any, token string) error

func DoPostOnBehalfOf

func DoPostOnBehalfOf(client *http.Client, url string, params any, output any, token string, onBehalfOf string) error

func DoPut

func DoPut(client *http.Client, url string, params any, output any, token string) error

func DoPutBehalfOf

func DoPutBehalfOf(client *http.Client, url string, params any, output any, token string, onBehalfOf string) error

func GetClient

func GetClient(id string) *http.Client

func GetId2FromUrl

func GetId2FromUrl(c *gin.Context) (uint, error)

func GetIdFromUrl

func GetIdFromUrl(c *gin.Context) (uint, error)

func GetPagingParams

func GetPagingParams(c *gin.Context) (offset int, limit int, errV error)

func GetParamAsBool

func GetParamAsBool(c *gin.Context, name string, defValue bool) (bool, error)

func GetParamAsInt

func GetParamAsInt(c *gin.Context, name string, defValue int) (int, error)

func GetParamAsString

func GetParamAsString(c *gin.Context, name string, defValue string) string

func NewBadRequestError

func NewBadRequestError(message string, params ...any) error

func NewForbiddenError

func NewForbiddenError(message string, params ...any) error

func NewNotFoundError

func NewNotFoundError(message string, params ...any) error

func NewServerError

func NewServerError(message string, params ...any) error

func NewServerErrorByError

func NewServerErrorByError(err error) error

func NewServiceUnavailableError

func NewServiceUnavailableError(message string, params ...any) error

func NewUnprocessableEntityError

func NewUnprocessableEntityError(message string, params ...any) error

func ReturnError

func ReturnError(c *gin.Context, err error)

func ReturnForbiddenError

func ReturnForbiddenError(c *gin.Context, message string)

func ReturnList

func ReturnList(c *gin.Context, result any, offset int, limit int, size int) error

func ReturnUnauthorizedError

func ReturnUnauthorizedError(c *gin.Context, message string)

Types

type AppError

type AppError struct {
	Code    int
	Message string
}

func (AppError) Error

func (e AppError) Error() string

Jump to

Keyboard shortcuts

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