Documentation
¶
Index ¶
- Constants
- Variables
- func AsReadCloser(ctx context.Context, factory func(w io.WriteCloser) func() error) io.ReadCloser
- func Pipe(r func(r io.Reader) error, w func(w io.Writer) error) error
- type Builder
- type Content
- type FilenameModifier
- type HeaderApplier
- type LengthDescriber
- type LengthModifier
- type MediaTypeDescriber
- type MediaTypeModifier
- type Modifier
- type Provider
- type Reader
- type ReaderFrom
- type WithFilename
- type WithHeader
- type Writer
Constants ¶
View Source
const ( MaxBufferSize = 32 << 20 // 32 MB MaxFilesize = 32 << 20 // 32 MB )
Variables ¶
View Source
var ( TWithFilename = reflect.TypeFor[WithFilename]() TWithHeader = reflect.TypeFor[WithHeader]() )
Functions ¶
func AsReadCloser ¶
func AsReadCloser(ctx context.Context, factory func(w io.WriteCloser) func() error) io.ReadCloser
Types ¶
type Builder ¶
type Builder interface {
Content
SetContentType(string)
SetContentLength(int64)
SetReadCloser(io.ReadCloser)
}
func NewBuilder ¶
type Content ¶
type Content interface {
ContentType() string
ContentLength() int64
io.ReadCloser
}
Content payload content
type FilenameModifier ¶
type FilenameModifier interface {
SetFilename(string)
}
FilenameModifier for setting multipart content filename
type HeaderApplier ¶
type LengthDescriber ¶
type LengthDescriber interface {
ContentLength() int64
}
type LengthModifier ¶
type LengthModifier interface {
SetContentLength(int64)
}
type MediaTypeDescriber ¶
type MediaTypeDescriber interface {
ContentType() string
}
type MediaTypeModifier ¶
type MediaTypeModifier interface {
SetContentType(string)
}
type Reader ¶
Reader defined the behavior of reading data from an io.ReadCloser and deserializing into `dst`.
type ReaderFrom ¶
type ReaderFrom interface {
ReadFrom(rc io.ReadCloser) (int64, error)
}
type WithFilename ¶
type WithFilename interface {
Filename() string
}
WithFilename for getting multipart content filename
type WithHeader ¶
Click to show internal directories.
Click to hide internal directories.