Help us shape the future of Go! Take the 2026 Go Developer Survey

apiform

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(value any, writer *multipart.Writer) error

Marshal encodes a value as multipart form data using default settings

func MarshalWithSettings

func MarshalWithSettings(value any, writer *multipart.Writer, arrayFormat FormFormat) error

MarshalWithSettings encodes a value with custom array format

Types

type FormFormat

type FormFormat int
const (
	// FormatRepeat represents arrays as repeated keys with the same value
	FormatRepeat FormFormat = iota
	// Comma-separated values 1,2,3
	FormatComma
	// FormatBrackets uses the key[] notation for arrays
	FormatBrackets
	// FormatIndicesDots uses key.0, key.1, etc. notation
	FormatIndicesDots
	// FormatIndicesBrackets uses key[0], key[1], etc. notation
	FormatIndicesBrackets
)

type Marshaler

type Marshaler interface {
	MarshalMultipart() ([]byte, string, error)
}

Jump to

Keyboard shortcuts

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