2018-05-29 13:42:41 +00:00
|
|
|
package multipart
|
|
|
|
|
2019-11-21 21:35:00 +00:00
|
|
|
import "git.xdrm.io/go/aicra/internal/cerr"
|
2019-05-01 16:01:32 +00:00
|
|
|
|
2018-09-25 19:22:25 +00:00
|
|
|
// ErrMissingDataName is set when a multipart variable/file has no name="..."
|
2019-11-21 21:35:00 +00:00
|
|
|
const ErrMissingDataName = cerr.Error("data has no name")
|
2018-09-25 19:22:25 +00:00
|
|
|
|
|
|
|
// ErrDataNameConflict is set when a multipart variable/file name is already used
|
2019-11-21 21:35:00 +00:00
|
|
|
const ErrDataNameConflict = cerr.Error("data name conflict")
|
2018-09-25 19:22:25 +00:00
|
|
|
|
|
|
|
// ErrNoHeader is set when a multipart variable/file has no (valid) header
|
2019-11-21 21:35:00 +00:00
|
|
|
const ErrNoHeader = cerr.Error("data has no header")
|
2018-09-25 19:22:25 +00:00
|
|
|
|
|
|
|
// Component represents a multipart variable/file
|
|
|
|
type Component struct {
|
|
|
|
// Content Type (raw for variables ; exported from files)
|
|
|
|
ContentType string
|
|
|
|
|
|
|
|
// data headers
|
|
|
|
Headers map[string]string
|
|
|
|
|
|
|
|
// actual data
|
|
|
|
Data []byte
|
|
|
|
}
|