Top 4.5% forks on proxy.golang.org
proxy.golang.org : github.com/robfig/bind
Package bind converts between form encoding and Go values. It comes with binders for all values, time.Time, arbitrary structs, and slices. In particular, binding functions are provided for the following types: Callers may also hook into the process and provide a custom binding function. This example binds data from embedded URL arguments, the query string, and a posted form. Booleans are converted to Go by comparing against the following strings: The "on" / "" syntax is supported as the default behavior for HTML checkboxes. The SQL standard time formats [“2006-01-02”, “2006-01-02 15:04”] are recognized by the default datetime binder. More may be added by the application to the TimeFormats variable, like this: File uploads may be bound to any of the following types: This is a wrapper around the upload handling provided by Go’s multipart package. The bytes stay in memory unless they exceed a threshold (10MB by default), in which case they are written to a temp file. Note: Binding a file upload to os.File requires it to be written to a temp file (if it wasn’t already), making it less efficient than the other types. Both indexed and unindexed slices are supported. These two forms are bound as unordered slices: This is bound as an ordered slice: The two forms may be combined, with unindexed elements filling any gaps between indexed elements. Note that if the slice element is a struct, it must use the indexed notation. Structs are bound using a dot notation. For example: Struct fields must be exported to be bound. Additionally, all params may be bound as members of a struct, rather than extracting a single field.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/robfig/bind
License: MIT
Latest release: almost 11 years ago
First release: almost 11 years ago
Namespace: github.com/robfig
Stars: 28 on GitHub
Forks: 6 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 3 months ago