Liking cljdoc? Tell your friends :D

ring-range-middleware.core

Middleware that handles HTTP range requests

Middleware that handles HTTP range requests
raw docstring

add-accept-ranges-header-to-responseclj

(add-accept-ranges-header-to-response response)
source

at-least-one-digitclj

source

boundary-charsclj

source

boundary-generatorclj

(boundary-generator)
source

BufferingRangeBodyclj

source

byte-or-suffix-byte-range-specclj

source

byte-or-suffix-byte-range-spec-regexclj

source

byte-range-setclj

source

byte-range-specclj

source

byte-ranges-specifierclj

source

byte-ranges-specifier-regexclj

source

bytes-unitclj

source

ClosedByteRangeclj

source

find-body-content-lengthclj

(find-body-content-length {:keys [body] :as response})
source

first-byte-posclj

source

IBufferableBodycljprotocol

bufferclj

(buffer this response)

Start buffering until the body is read. Returns the number of bytes read.

Start buffering until the body is read. Returns the number of bytes read.
source

IByteRangecljprotocol

anticipated-number-of-bytes-to-write-to-streamclj

(anticipated-number-of-bytes-to-write-to-stream this
                                                bytes
                                                bytes-offset
                                                bytes-length
                                                num-bytes-read)

content-rangeclj

(content-range this total-body-length)

Value of the Content-Range header, given a total body length

Value of the Content-Range header, given a total body length

end-byteclj

(end-byte this total-body-length)

Returns the end byte offset, given the total body length

Returns the end byte offset, given the total body length

lengthclj

(length this total-body-length)

Length of the range in bytes, given a total body length

Length of the range in bytes, given a total body length

maybe-write-bytes-to-streamclj

(maybe-write-bytes-to-stream this
                             bytes
                             bytes-offset
                             bytes-length
                             num-bytes-read
                             output-stream)

start-byteclj

(start-byte this total-body-length)

Returns the start byte offset, given the total body length

Returns the start byte offset, given the total body length

to-closed-byte-rangeclj

(to-closed-byte-range this total-body-length)

If the total body length is known, every range can be converted to a closed range form. This fn does that.

If the total body length is known, every range can be converted to a closed range form. This fn does that.

valid?clj

(valid? this)
(valid? this total-body-length)

Returns whether or not the range is valid. If the total body length is given, checks against that as well.

Returns whether or not the range is valid. If the total body length is given, checks against that as well.
source

IContentLengthPrecalculatorcljprotocol

content-lengthclj

(content-length this)

Precalculates the content length before the body is written

Precalculates the content length before the body is written
source

last-byte-posclj

source

limited-size-byte-array-output-streamclj

(limited-size-byte-array-output-stream max-size)
source

multipart-newlineclj

source

OpenEndedByteRangeclj

source

optional-whitespaceclj

source

range-header-responseclj

(range-header-response response request opts)

Fulfills the Range header request. See: wrap-range-header.

Fulfills the Range header request. See: wrap-range-header.
sourceraw docstring

sort-byte-rangesclj

(sort-byte-ranges ranges)
source

str-num-bytesclj

(str-num-bytes string)
source

StreamingRangeBodyclj

source

suffix-byte-range-specclj

source

suffix-lengthclj

source

SuffixByteRangeclj

source

validate-rangesclj

(validate-ranges ranges {:keys [max-num-ranges] :as opts})
(validate-ranges ranges opts total-body-length)

Checks that ranges are not overlapping relative to each other. NOTE: because the total body length may not be known, byte offsets cannot be absolutely checked. This means at most one of a suffix byte range or open-ended byte range can exist.

If the body length is known, the ranges are checked against the body length.

Checks that ranges are not overlapping relative to each other.
NOTE: because the total body length may not be known, byte offsets cannot be absolutely checked.
This means at most one of a suffix byte range or open-ended byte range can exist.

If the body length is known, the ranges are checked against the body length.
sourceraw docstring

wrap-range-headerclj

(wrap-range-header handler)
(wrap-range-header handler opts)

Middleware that attempts to fulfill the Range header in the request, if any.

If the requested Range has valid byte offsets and no overlapping ranges, returns 206 with the requested bytes. Otherwise, returns the original response.

A single range is returned directly as bytes in the body. Multiple ranges are returned as a multipart/byteranges response as per RFC7233.

Accepts the following options:

:boundary-generator-fn - a function that returns a boundary string for multipart responses. Defaults to a randomly generated alphanumeric string :max-num-ranges - the maximum number of ranges to accept in the Range header. Default is 10. :max-buffer-size-per-range-bytes - maximum buffer size per range. Used when the Content-Length of the body is unknown. Defaults to 1MiB.

Middleware that attempts to fulfill the Range header in the request, if any.

If the requested Range has valid byte offsets and no overlapping ranges, returns 206 with the requested bytes.
Otherwise, returns the original response.

A single range is returned directly as bytes in the body. Multiple ranges are returned as a multipart/byteranges
response as per RFC7233.

Accepts the following options:

:boundary-generator-fn - a function that returns a boundary string for multipart responses.
                         Defaults to a randomly generated alphanumeric string
:max-num-ranges - the maximum number of ranges to accept in the Range header.
                  Default is 10.
:max-buffer-size-per-range-bytes - maximum buffer size per range. Used when the Content-Length of the body
                                   is unknown. Defaults to 1MiB.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close