aicra/internal/multipart/types.go

31 lines
840 B
Go
Raw Normal View History

package multipart
2020-03-16 11:53:48 +00:00
// Error allows you to create constant "const" error with type boxing.
type Error string
// Error implements the error builtin interface.
func (err Error) Error() string {
return string(err)
}
2018-09-25 19:22:25 +00:00
// ErrMissingDataName is set when a multipart variable/file has no name="..."
2020-03-16 11:53:48 +00:00
const ErrMissingDataName = 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
2020-03-16 11:53:48 +00:00
const ErrDataNameConflict = Error("data name conflict")
2018-09-25 19:22:25 +00:00
// ErrNoHeader is set when a multipart variable/file has no (valid) header
2020-03-16 11:53:48 +00:00
const ErrNoHeader = 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
}