request

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapFormToStruct

func MapFormToStruct(r *http.Request, dest interface{}) error

Types

type MappingError

type MappingError struct {
	// contains filtered or unexported fields
}

func (*MappingError) Error

func (e *MappingError) Error() string

type RequestContext added in v0.1.8

type RequestContext interface {
	GetRequest() *http.Request
	GetWriter() http.ResponseWriter
	GetDI() serverdi.Context
	GetURI() *URI

	BindJSON(dest interface{}) error
	BindForm(dest interface{}) error

	JSON(status int, data interface{})
	String(status int, text string)
	Status(status int)

	Set(key string, value interface{})
	Get(key string) (interface{}, bool)
}

func NewContext added in v0.1.8

type URI added in v0.1.8

type URI struct {
	Path          string
	Query         url.Values
	PathVariables map[string]string
}

func NewURI added in v0.1.8

func NewURI(r *http.Request) *URI

func (*URI) ExtractPathVariables added in v0.1.8

func (u *URI) ExtractPathVariables(pattern string)

func (*URI) GetAllPathVariables added in v0.1.8

func (u *URI) GetAllPathVariables() map[string]string

func (*URI) GetPath added in v0.1.8

func (u *URI) GetPath() string

func (*URI) GetPathVariable added in v0.1.8

func (u *URI) GetPathVariable(key string) string

func (*URI) GetQuery added in v0.1.8

func (u *URI) GetQuery(key string) string

func (*URI) HasQuery added in v0.1.8

func (u *URI) HasQuery(key string) bool

func (*URI) SetPathVariable added in v0.1.8

func (u *URI) SetPathVariable(key, value string)

Jump to

Keyboard shortcuts

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