multipart

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DigestReaderAt added in v1.1.0

func DigestReaderAt(ctx context.Context, readerAt io.ReaderAt, byteLength int64) (string, error)

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

func ValidateReplyImages(images [][]byte) error

func ValidateReplyMultipartEnvelope

func ValidateReplyMultipartEnvelope(metadataBytes []byte, bodyLength int64) error

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 NewFileBodyFactory(
	ctx context.Context,
	boundary string,
	metadataBytes []byte,
	fileName string,
	contentType string,
	byteLength int64,
	readerAt io.ReaderAt,
) (*FileBodyFactory, error)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL