Feat: http read seeker with start offset

pull/21/head
zijiren233 2 years ago
parent f2371d3288
commit ed6d86fc1c

@ -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,

Loading…
Cancel
Save