Documentation
¶
Index ¶
- func DigestReaderAt(ctx context.Context, readerAt io.ReaderAt, byteLength int64) (string, error)
- func NormalizeReplyFile(fileName, contentType string, byteLength int64, readerAt io.ReaderAt) (string, error)
- func ValidateReplyImages(images [][]byte) error
- func ValidateReplyMultipartEnvelope(metadataBytes []byte, bodyLength int64) error
- type BodyFactory
- type FileBodyFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DigestReaderAt ¶ added in v1.1.0
DigestReaderAt computes the exact file digest without taking ownership of the supplied reader. A short or unstable source fails before any network request.
func NormalizeReplyFile ¶ added in v1.1.0
func NormalizeReplyFile(fileName, contentType string, byteLength int64, readerAt io.ReaderAt) (string, error)
NormalizeReplyFile validates the client-side representation against the Iris multipart file-reply contract. The file name is preserved byte-for-byte while the MIME type is canonicalized to lower case.
func ValidateReplyImages ¶
Types ¶
type BodyFactory ¶
type BodyFactory struct {
// contains filtered or unexported fields
}
func NewBodyFactory ¶
func NewBodyFactory(boundary string, metadataBytes []byte, images [][]byte, contentTypes []string) *BodyFactory
func (*BodyFactory) BodyLength ¶
func (f *BodyFactory) BodyLength() int64
func (*BodyFactory) BodySHA256 ¶
func (f *BodyFactory) BodySHA256() string
func (*BodyFactory) ContentType ¶
func (f *BodyFactory) ContentType() string
func (*BodyFactory) NewBody ¶
func (f *BodyFactory) NewBody() (io.ReadCloser, error)
type FileBodyFactory ¶ added in v1.1.0
type FileBodyFactory struct {
// contains filtered or unexported fields
}
func NewFileBodyFactory ¶ added in v1.1.0
func (*FileBodyFactory) BodyLength ¶ added in v1.1.0
func (f *FileBodyFactory) BodyLength() int64
func (*FileBodyFactory) BodySHA256 ¶ added in v1.1.0
func (f *FileBodyFactory) BodySHA256() string
func (*FileBodyFactory) ContentType ¶ added in v1.1.0
func (f *FileBodyFactory) ContentType() string
func (*FileBodyFactory) NewBody ¶ added in v1.1.0
func (f *FileBodyFactory) NewBody() (io.ReadCloser, error)
Click to show internal directories.
Click to hide internal directories.