Versions in this module Expand all Collapse all v0 v0.1.1 Nov 15, 2026 Changes in this version + const CodeBodyTooLarge + const CodeInvalidBody + const CodeMalformedBody + const CodeMalformedHeader + const CodeUnsupportedMediaType + const DefaultMaxBodyBytes + const FieldTooMany + const FieldUnknown + const IdempotencyHeader + const InBody + const InHeader + const InQuery + const ProblemContentType + const ProblemTypeBase + func BindJSON(r *http.Request, dst any, options ...BodyOption) error + func BindJSONBytes(data []byte, dst any, options ...BodyOption) error + func BodySchema(v any) (map[string]any, error) + func ErrorSchema() map[string]any + func IdempotencyKey(r *http.Request) (string, error) + func OpenAPIProblemResponse(status int) map[string]any + func OpenAPIRequestBody(v any) (map[string]any, error) + func OpenAPIRequestBodyOf(fields []Field) (map[string]any, error) + func RequestBinding(r *http.Request, principal ...string) string + type BodyOption func(*bodyConfig) + func MaxBytes(n int64) BodyOption + type Date struct + Day int + Month time.Month + Year int + func DateOf(t time.Time) Date + func ParseDate(value string) (Date, error) + func (d *Date) UnmarshalJSON(data []byte) error + func (d Date) In(location *time.Location) time.Time + func (d Date) IsZero() bool + func (d Date) MarshalJSON() ([]byte, error) + func (d Date) String() string type Field + Bits int + Elem *Field + Pointer bool type FieldError + Detail string + In string type FieldType + const FieldAny + const FieldDate + const FieldList + const FieldNumber + const FieldObject type Problem + Detail string + Errors []FieldError + Title string + Type string + func NewProblem(status int, code, detail string, errors ...FieldError) *Problem v0.1.0 Nov 15, 2026 Changes in this version + const CodeInternal + const CodeInvalidQuery + const CodeMalformedQuery + const DefaultLimit + const FieldConflict + const FieldInvalid + const FieldInvalidCursor + const FieldOutOfRange + const FieldRequired + const FieldTooLong + const FieldUnknownValue + const MaxCursorLength + const MaxLimit + const Version + const VersionExtension + func BindQuery(r *http.Request, dst any) error + func BindValues(values url.Values, dst any) error + func InputSchema(v any) (map[string]any, error) + func OpenAPIParameters(v any) ([]map[string]any, error) + func OpenAPIParametersOf(fields []Field) ([]map[string]any, error) + func QueryBinding(values url.Values, principal ...string) string + func WriteError(w http.ResponseWriter, status int, code, message string, fields ...FieldError) error + func WriteJSON(w http.ResponseWriter, status int, value any) error + func WriteList[T any](w http.ResponseWriter, items []T, next string) error + func WriteProblem(w http.ResponseWriter, err error) error + type Cursors struct + func NewCursors(key []byte) (*Cursors, error) + func (c *Cursors) Decode(cursor, binding string, position any) error + func (c *Cursors) Encode(binding string, position any) (string, error) + type ErrorBody struct + Code string + Error string + Fields []FieldError + type Field struct + Anonymous bool + Exported bool + Fields []Field + Name string + Range bool + Tag reflect.StructTag + Type FieldType + type FieldError struct + Code string + Message string + Name string + type FieldType int + const FieldBool + const FieldInt + const FieldLocation + const FieldOther + const FieldSort + const FieldString + const FieldStrings + const FieldStruct + const FieldTime + type List struct + Items []T + NextCursor string + Total *int + func NewList[T any](items []T, next string) List[T] + type Page struct + Cursor string + Limit int + type Problem struct + Code string + Fields []FieldError + Message string + Status int + func (p *Problem) Body() ErrorBody + func (p *Problem) Error() string + type Range struct + From time.Time + To time.Time + type Search struct + Q string + type SortKey struct + Desc bool + Field string + type Zone struct + Location *time.Location