diff --git a/proxy/read_seeker.go b/proxy/read_seeker.go index 0a979cca..5c883f09 100644 --- a/proxy/read_seeker.go +++ b/proxy/read_seeker.go @@ -71,6 +71,14 @@ func WithContentLength(contentLength int64) HttpReadSeekerConf { } } +func WithStartOffset(offset int64) HttpReadSeekerConf { + return func(h *HttpReadSeeker) { + if offset >= 0 { + h.offset = offset + } + } +} + func NewHttpReadSeeker(url string, conf ...HttpReadSeekerConf) *HttpReadSeeker { rs := &HttpReadSeeker{ offset: 0,