core

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 9 Imported by: 6

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array[T any] = types.Array[T]

type Blob added in v0.6.0

type Blob struct {
	Data []byte
	Type string
}

type Body

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

func NewBodyFromJS

func NewBodyFromJS(v js.Value, contentType string) *Body

func (*Body) Blob added in v0.6.0

func (body *Body) Blob() (Blob, error)

func (*Body) Form

func (body *Body) Form() (Dict, error)

func (*Body) JSON

func (body *Body) JSON() (Dict, error)

func (*Body) Kind

func (body *Body) Kind() Kind

func (*Body) Multipart added in v0.6.0

func (body *Body) Multipart() (Multipart, error)

func (*Body) Text

func (body *Body) Text() (string, error)

type Dict

type Dict = types.Dict

type Kind

type Kind int
const (
	KindNone Kind = iota
	KindText
	KindJSON
	KindForm
	KindMultipart
	KindBlob
)

type Multipart added in v0.6.1

type Multipart struct {
	Form  Dict
	Files []UploadFile
}

type Object

type Object[T any] = types.Object[T]

type Request

type Request struct {
	Url     URL
	Body    *Body
	Path    *RequestBag
	Query   *RequestBag
	Headers *RequestBag
	Cookies *RequestBag
}

type RequestBag

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

func NewRequestBag

func NewRequestBag(data Dict, name string) *RequestBag

func (*RequestBag) Get

func (rb *RequestBag) Get(key string) (string, error)

func (*RequestBag) Has

func (rb *RequestBag) Has(key string) bool

func (*RequestBag) Parse

func (rb *RequestBag) Parse(schema *pema.SchemaBuilder, coerce ...bool) (Dict, error)

func (*RequestBag) Size

func (rb *RequestBag) Size() int

func (*RequestBag) ToJSON

func (rb *RequestBag) ToJSON() map[string]string

func (*RequestBag) Try

func (rb *RequestBag) Try(key string) string

type URL

type URL struct {
	Href         string
	Origin       string
	Protocol     string
	Username     string
	Password     string
	Host         string
	Hostname     string
	Port         string
	Pathname     string
	Search       string
	SearchParams Dict
	Hash         string
}

type UploadFile

type UploadFile struct {
	Field string
	Name  string
	Type  string
	Size  int64
	Bytes []byte
}

Jump to

Keyboard shortcuts

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