Documentation ¶
Index ¶
- Constants
- func PrettySizeString(size int64) string
- func PrettySpeedString(speed int64) string
- type Control
- type Monitor
- type MonitorProgressCb
- type ProgressStatus
- type Request
- func (req *Request) BodyString(v string) *Request
- func (req *Request) BodyUploadFile(filename, filepath string) *Request
- func (req *Request) ControlDownload() (ctrl *Control)
- func (req *Request) DialTimeout(timeout time.Duration) *Request
- func (req *Request) Do() (res Response, err error)
- func (req *Request) Header(k, v string) *Request
- func (req *Request) Method(method string) *Request
- func (req *Request) MonitorDownload() (mon *Monitor)
- func (req *Request) MonitorUpload() (mon *Monitor)
- func (req *Request) Progress(cb MonitorProgressCb, interval time.Duration) *Request
- func (req *Request) SaveToFile(filepath string) *Request
- func (req *Request) Timeout(timeout time.Duration) *Request
- func (req *Request) TraceRequest(w io.Writer) *Request
- func (req *Request) TraceRequestBody(w io.Writer) *Request
- func (req *Request) UserAgent(v string) *Request
- type Response
Constants ¶
View Source
const ( Connecting = iota Uploading Downloading Closed )
Variables ¶
This section is empty.
Functions ¶
func PrettySizeString ¶
func PrettySpeedString ¶
Types ¶
type MonitorProgressCb ¶
type MonitorProgressCb func(p ProgressStatus)
type ProgressStatus ¶
type Request ¶
type Request struct { Headers http.Header Upload ProgressStatus Download ProgressStatus // contains filtered or unexported fields }
func (*Request) BodyString ¶
func (*Request) BodyUploadFile ¶
func (*Request) ControlDownload ¶
func (*Request) MonitorDownload ¶
func (*Request) MonitorUpload ¶
func (*Request) Progress ¶
func (req *Request) Progress(cb MonitorProgressCb, interval time.Duration) *Request
func (*Request) SaveToFile ¶
type Response ¶
type Response struct { HttpResponse *http.Response StatusCode int Headers http.Header Body string UploadStatus ProgressStatus DownloadStatus ProgressStatus }
Click to show internal directories.
Click to hide internal directories.