request

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Bind

func Bind[T any](c *gin.Context) (*T, error)

func BindJSON

func BindJSON[T any](c *gin.Context) (*T, error)

func BindJSONValue

func BindJSONValue(c *gin.Context, r interface{}) error

func BindQuery

func BindQuery[T any](c *gin.Context) (*T, error)

func BindUri

func BindUri[T any](c *gin.Context) (*T, error)

func Id

func Id(c *gin.Context) (int, error)

func TxHandle

func TxHandle(c *gin.Context) *gorm.DB

func UUID

func UUID(c *gin.Context) (string, error)

Types

type FilterRequest

type FilterRequest struct {
	OrderBy map[string]string
}

func Filter

func Filter(c *gin.Context) (*FilterRequest, error)

type IdRequest

type IdRequest struct {
	Id int `uri:"id" binding:"required"`
}

type MetaRequest

type MetaRequest struct {
	*PaginationRequest
	*FilterRequest
}

func Meta

func Meta(c *gin.Context) (*MetaRequest, error)

type PaginationRequest

type PaginationRequest struct {
	Limit               int  `form:"limit" binding:"omitempty"`
	Offset              int  `form:"offset" binding:"omitempty"`
	MustReturnTotalRows bool `form:"count" binding:"omitempty"`
}

func Pagination

func Pagination(c *gin.Context) (*PaginationRequest, error)

type UUIDRequest

type UUIDRequest struct {
	UUID string `uri:"uuid" binding:"required"`
}

Jump to

Keyboard shortcuts

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