request

package
v1.0.0-beta.226 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSortByInvalid     = errors.New("invalid sort by")
	ErrSortFieldRequired = errors.New("sort field is required")
	ErrSortOrderInvalid  = errors.New("sort order must be either asc or desc")
)

Functions

func ParseBody

func ParseBody(r *http.Request, payload any) *apierrors.BaseAPIError

Types

type SortBy

type SortBy struct {
	Field string
	Order SortOrder
}

func ParseSortBy

func ParseSortBy(sort string) (*SortBy, error)

func (*SortBy) UnmarshalText

func (s *SortBy) UnmarshalText(text []byte) error

func (SortBy) Validate

func (s SortBy) Validate() error

type SortOrder

type SortOrder string
const (
	SortOrderAsc  SortOrder = "asc"
	SortOrderDesc SortOrder = "desc"
)

func (SortOrder) ToSortxOrder

func (s SortOrder) ToSortxOrder() sortx.Order

func (SortOrder) Validate

func (s SortOrder) Validate() error

Jump to

Keyboard shortcuts

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