request

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignRequestParamsToDomainObject

func AssignRequestParamsToDomainObject(params Params, domainObject domain.Object) error

func Field

func Field[T any](params Params, fieldName string) (T, error)

func FormBody

func FormBody(c *api.Context, params Params) error

func JsonBody

func JsonBody(c *api.Context, params Params) error

func MultipartForm

func MultipartForm(c *api.Context, params Params) error

func PathParams

func PathParams(c *api.Context, params Params) error

func QueryParams

func QueryParams(c *api.Context, params Params) error

func ToConcrete

func ToConcrete[T Params](params Params) (T, error)

func XMLBody

func XMLBody(c *api.Context, params Params) error

Types

type BaseQuery

type BaseQuery struct {
	PageNo   int `form:"pageNo" assign:"-"`
	PageSize int `form:"pageSize" assign:"-"`
}

func (*BaseQuery) GetPageNo

func (q *BaseQuery) GetPageNo() int

func (*BaseQuery) GetPageSize

func (q *BaseQuery) GetPageSize() int

type BaseQueryWithID

type BaseQueryWithID struct {
	IDQuery
	BaseQuery
}

type IDJsonBody

type IDJsonBody struct {
	ID string `json:"id" binding:"required" assign:"toField:ID"`
}

func (*IDJsonBody) GetID

func (id *IDJsonBody) GetID() string

func (*IDJsonBody) GetTenantID

func (id *IDJsonBody) GetTenantID() string

type IDPath

type IDPath struct {
	ID string `uri:"id" binding:"required" assign:"toField:ID"`
}

func (*IDPath) GetID

func (id *IDPath) GetID() string

func (*IDPath) GetTenantID

func (id *IDPath) GetTenantID() string

type IDQuery

type IDQuery struct {
	ID string `form:"id" binding:"required" assign:"toField:ID"`
}

func (*IDQuery) GetID

func (id *IDQuery) GetID() string

func (*IDQuery) GetTenantID

func (id *IDQuery) GetTenantID() string

type Params

type Params interface{}

type Query

type Query interface {
	Params
	GetPageNo() int
	GetPageSize() int
}

type QueryWithID

type QueryWithID interface {
	WithID
	Query
}

type TenantID

type TenantID interface {
	Params
	GetTenantID() string
}

type TenantIDJsonBody

type TenantIDJsonBody struct {
	TenantID string `json:"tenant_id" binding:"required" assign:"toField:TenantID"`
}

type TenantIDPath

type TenantIDPath struct {
	TenantID string `uri:"tenant_id" binding:"required" assign:"toField:TenantID"`
}

type TenantIDQuery

type TenantIDQuery struct {
	TenantID string `form:"tenant_id" binding:"required" assign:"toField:TenantID"`
}

type WithID

type WithID interface {
	Params
	GetID() string
}

Jump to

Keyboard shortcuts

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