maxwell v1.0.1 Maxwell.Multipart

Process mutipart for adapter

Summary

Functions

Return a random boundary(binary)

Receives lists list's member format: 1. {:file, path} 2. {:file, path, extra_headers} 3. {:file, path, disposition, extra_headers} 4. {:mp_mixed, name, mixed_boundary} 5. {:mp_mixed_eof, mixed_boundary} 6. {name, bin_data} 7. {name, bin_data, extra_headers} 8. {name, bin_data, disposition, extra_headers}

Get the size of a mp stream. Useful to calculate the content-length of a full multipart stream and send it as an identity

Functions

boundary()

Return a random boundary(binary)

   "---------------------------mtynipxrmpegseog"
encode(parts)

Receives lists list's member format: 1. {:file, path} 2. {:file, path, extra_headers} 3. {:file, path, disposition, extra_headers} 4. {:mp_mixed, name, mixed_boundary} 5. {:mp_mixed_eof, mixed_boundary} 6. {name, bin_data} 7. {name, bin_data, extra_headers} 8. {name, bin_data, disposition, extra_headers}

Returns {body_binary, size}

encode(boundary, parts)
len_mp_stream(boundary, parts)

Get the size of a mp stream. Useful to calculate the content-length of a full multipart stream and send it as an identity

Receives parameter as Maxwell.Multipart.encode

Return stream size(integer)