form

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package form provides form data values exposed to WebGo programs.

Index

Constants

View Source
const (
	ContentTypeURLEncoded = "application/x-www-form-urlencoded;charset=UTF-8"
)

Variables

View Source
var (
	ErrInvalidField = errors.New("invalid FormData field")
	ErrTooLarge     = errors.New("FormData exceeds size limit")
)

Functions

This section is empty.

Types

type Entry

type Entry struct{ Name, Value string }

Entry is one ordered FormData field name/value pair.

type FormData

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

FormData stores ordered text form fields. File and multipart entries are not supported.

func New

func New() *FormData

New creates an empty FormData value.

func (*FormData) Append

func (data *FormData) Append(name, value string) error

Append adds a text field without removing existing values for name.

func (*FormData) Delete

func (data *FormData) Delete(name string)

Delete removes all values for name.

func (*FormData) Encode

func (data *FormData) Encode() (string, error)

Encode serializes fields as an application/x-www-form-urlencoded body.

func (*FormData) Entries

func (data *FormData) Entries() []Entry

Entries returns a defensive ordered copy.

func (*FormData) Get

func (data *FormData) Get(name string) (string, bool)

Get returns the first value for name.

func (*FormData) GetAll

func (data *FormData) GetAll(name string) []string

GetAll returns every value for name in insertion order.

func (*FormData) Has

func (data *FormData) Has(name string) bool

Has reports whether name has at least one value.

func (*FormData) Set

func (data *FormData) Set(name, value string) error

Set replaces all values for name while retaining the first matching position.

Jump to

Keyboard shortcuts

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