Documentation
¶
Overview ¶
Package web provides Go struct definitions for Web API types used by transpiled TypeScript code. These types mirror the Web API spec (Request, Response, Headers, URL, etc.) with Go-idiomatic field access and methods.
Index ¶
- type FormData
- func (f *FormData) Append(name, value string)
- func (f *FormData) Await() (*FormData, error)
- func (f *FormData) Delete(name string)
- func (f *FormData) ForEach(fn func(value any, key string))
- func (f *FormData) Get(name string) string
- func (f *FormData) Has(name string) bool
- func (f *FormData) Set(name, value string)
- type Headers
- func (h *Headers) Append(name, value string)
- func (h *Headers) Delete(name string)
- func (h *Headers) Entries() map[string]string
- func (h *Headers) ForEach(fn func(value, key string))
- func (h *Headers) Get(name string) string
- func (h *Headers) GetSetCookie() []string
- func (h *Headers) Has(name string) bool
- func (h *Headers) Raw() http.Header
- func (h *Headers) Set(name, value string)
- type Request
- type Response
- type TextEncoder
- type URL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FormData ¶
type FormData struct {
// contains filtered or unexported fields
}
FormData is a simplified FormData representation.
func NewFormData ¶
func NewFormData() *FormData
type Headers ¶
type Headers struct {
// contains filtered or unexported fields
}
Headers wraps http.Header with Web API-compatible methods.
func NewHeaders ¶
func (*Headers) GetSetCookie ¶
type Request ¶
Request represents a Web API Request.
func (*Request) ArrayBuffer ¶
ArrayBuffer returns the request body as bytes.
type Response ¶
type Response struct {
Body io.Reader
Headers *Headers
Status int
StatusText string
Ok bool
// contains filtered or unexported fields
}
Response represents a Web API Response.
func NewResponse ¶
func ResponseJSON ¶
ResponseJSON creates a JSON response.
func ResponseRedirect ¶
ResponseRedirect creates a redirect response.
type TextEncoder ¶
type TextEncoder struct{}
TextEncoder provides TextEncoder.encode().
func NewTextEncoder ¶
func NewTextEncoder() *TextEncoder
func (*TextEncoder) Encode ¶
func (e *TextEncoder) Encode(s *string) []byte
Click to show internal directories.
Click to hide internal directories.