curl: github.com/nareix/curl Index | Files

package curl

import "github.com/nareix/curl"

Index

Package Files

curl.go

Constants

const (
    Connecting = iota
    Uploading
    Downloading
    Closed
)

func PrettySizeString Uses

func PrettySizeString(size int64) string

func PrettySpeedString Uses

func PrettySpeedString(speed int64) string

type Control Uses

type Control struct {
    // contains filtered or unexported fields
}

func (*Control) Pause Uses

func (ctrl *Control) Pause()

func (*Control) Resume Uses

func (ctrl *Control) Resume()

func (*Control) Stop Uses

func (ctrl *Control) Stop()

type Monitor Uses

type Monitor struct {
    // contains filtered or unexported fields
}

type MonitorProgressCb Uses

type MonitorProgressCb func(p ProgressStatus)

type ProgressStatus Uses

type ProgressStatus struct {
    Stat          int
    ContentLength int64
    Size          int64
    Percent       float32
    AverageSpeed  int64
    Speed         int64
    MaxSpeed      int64
    TimeElapsed   time.Duration
    Paused        bool
}

type Request Uses

type Request struct {
    Headers http.Header

    Upload   ProgressStatus
    Download ProgressStatus
    // contains filtered or unexported fields
}

func Get Uses

func Get(url string) *Request

func New Uses

func New(url string) *Request

func Post Uses

func Post(url string) *Request

func (*Request) BodyString Uses

func (req *Request) BodyString(v string) *Request

func (*Request) BodyUploadFile Uses

func (req *Request) BodyUploadFile(filename, filepath string) *Request

func (*Request) ControlDownload Uses

func (req *Request) ControlDownload() (ctrl *Control)

func (*Request) DialTimeout Uses

func (req *Request) DialTimeout(timeout time.Duration) *Request

func (*Request) Do Uses

func (req *Request) Do() (res Response, err error)

func (*Request) Header Uses

func (req *Request) Header(k, v string) *Request

func (*Request) Method Uses

func (req *Request) Method(method string) *Request

func (*Request) MonitorDownload Uses

func (req *Request) MonitorDownload() (mon *Monitor)

func (*Request) MonitorUpload Uses

func (req *Request) MonitorUpload() (mon *Monitor)

func (*Request) Progress Uses

func (req *Request) Progress(cb MonitorProgressCb, interval time.Duration) *Request

func (*Request) SaveToFile Uses

func (req *Request) SaveToFile(filepath string) *Request

func (*Request) Timeout Uses

func (req *Request) Timeout(timeout time.Duration) *Request

func (*Request) TraceRequest Uses

func (req *Request) TraceRequest(w io.Writer) *Request

func (*Request) TraceRequestBody Uses

func (req *Request) TraceRequestBody(w io.Writer) *Request

func (*Request) UserAgent Uses

func (req *Request) UserAgent(v string) *Request

type Response Uses

type Response struct {
    HttpResponse   *http.Response
    StatusCode     int
    Headers        http.Header
    Body           string
    UploadStatus   ProgressStatus
    DownloadStatus ProgressStatus
}

Package curl imports 11 packages (graph) and is imported by 3 packages. Updated 2016-07-18. Refresh now. Tools for package owners.