request

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Copyright 2023 Kapeta Inc. SPDX-License-Identifier: MIT

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBody

func GetBody[T any](ctx echo.Context, returnValue *T) error

GetBody function takes two arguments: an echo context and a pointer to the return value. It used a JSON decoder to convert the request body into the return value. If the decoding fails, the function returns an error.

func GetHeaderParams

func GetHeaderParams[T any](ctx echo.Context, key string, returnValue *T) error

GetHeaderParams function takes three arguments: an echo context, a string key, and a pointer to the return value. It returns the value of the key from the header parameters. If the key is not found, the function returns an error.

func GetPathParams

func GetPathParams[T any](ctx echo.Context, key string, returnValue *T) error

GetPathParams function takes three arguments: an echo context, a string key, and a pointer to the return value. It returns the value of the key from the path parameters. If the key is not found, the function returns an error.

func GetQueryParam

func GetQueryParam[T any](ctx echo.Context, key string, returnValue *T) error

GetQueryParam function takes three arguments: an echo context, a string key, and a pointer to the return value. It returns the value of the key from the query parameters like /test?key=value If the key is not found, the function returns an error.

func GetRequestParameters added in v0.2.2

func GetRequestParameters[T any](req *http.Request, param *T) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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