Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type COA ¶
type COA int
COA is a short for Corse of Action, is the code returned by determining function based on error that occured during the download.
type IOErr ¶
type IOErr struct {
Err error
}
IOErr is an error that is reported when there is an error related to writing or reading the data.
type RangeSupport ¶
type RangeSupport byte
RangeSupport is a byte that indicates whether the server supports range requests.
const ( RangeSupportUnknown RangeSupport = iota // Range support is not yet known because no request has been made. RangeSupportYes // Byte serving is supported. When client resumes a download, it must send Range header. RangeSupportNo // Byte serving is not supported. Client has to re-download the entire file. )
type RequestErr ¶
type RequestErr struct {
Err error
}
RequestErr is an error that is reported when there is an error when processing the request.
func (*RequestErr) Error ¶
func (e *RequestErr) Error() string
func (*RequestErr) Is ¶
func (e *RequestErr) Is(target error) bool
func (*RequestErr) Unwrap ¶
func (e *RequestErr) Unwrap() error
type ResumeableDownload ¶
type ResumeableDownload struct {
// contains filtered or unexported fields
}
ResumeableDownload represents an HTTP download that can be resumed in case of failure, if byte serving is supported by the server.
func NewResumeableDownload ¶
func (*ResumeableDownload) Close ¶
func (r *ResumeableDownload) Close() error
func (*ResumeableDownload) Start ¶
func (r *ResumeableDownload) Start() error
Start starts the download loop.
type ServerMisconfiguredErr ¶
type ServerMisconfiguredErr struct { Expected int // Expected status code. Received int // Received status code. }
ServerMisconfiguredErr is an error that is reported when the server does not follow the RFC for byte serving and sends an incorrect response in request to send a slice of bytes.
func (*ServerMisconfiguredErr) Error ¶
func (e *ServerMisconfiguredErr) Error() string
func (*ServerMisconfiguredErr) Is ¶
func (e *ServerMisconfiguredErr) Is(target error) bool