gurlib

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const ADD_LINE = 1 << 62

Variables

This section is empty.

Functions

func ParseBody

func ParseBody(Body *[]byte)

func ParseMF

func ParseMF(mf string, formCache *[]FormVal)

func ParseTime

func ParseTime(t string) (rv time.Duration)

Types

type FormVal

type FormVal struct {
	Tag   string
	Fname string
	Body  []byte
}

type Gurl

type Gurl struct {
	*http.Client `json:"-"`

	GurlCore
}

func (*Gurl) Send

func (g *Gurl) Send() (*Response, error)

type GurlCore

type GurlCore struct {
	Method string `json:"method,omitempty"`

	J   []string `json:"J,omitempty"`
	F   []string `json:"F,omitempty"`
	H   []string `json:"H,omitempty"` // http header
	Url string   `json:"url,omitempty"`
	O   string   `json:"o,omitempty"`

	Jfa []string `json:"Jfa,omitempty"`

	FormCache []FormVal `json:"-"`

	Body       []byte `json:"body,omitempty"`
	Flag       int
	V          bool `json:"-"`
	A          string
	Color      bool
	Query      []string
	NotParseAt map[string]struct{}
}

func CopyAndNew

func CopyAndNew(g *GurlCore) *GurlCore

func (*GurlCore) AddFormStr

func (g *GurlCore) AddFormStr(F []string)

func (*GurlCore) AddJsonFormStr

func (g *GurlCore) AddJsonFormStr(Jfa []string)

func (*GurlCore) GetOrBodyExec

func (g *GurlCore) GetOrBodyExec(client *http.Client) (*Response, error)

func (*GurlCore) HeadersAdd

func (g *GurlCore) HeadersAdd(req *http.Request)

func (*GurlCore) MultipartExec

func (g *GurlCore) MultipartExec(client *http.Client) (*Response, error)

func (*GurlCore) MultipartNew

func (g *GurlCore) MultipartNew() (*http.Request, chan error, error)

func (*GurlCore) ParseInit

func (g *GurlCore) ParseInit()

func (*GurlCore) SendExec

func (g *GurlCore) SendExec(client *http.Client) (*Response, error)

type Message

type Message struct {
	In      chan string
	Out     chan string
	InDone  chan string
	OutDone chan string
	K       int
}

type Report

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

func NewReport

func NewReport(c, n int, url string) *Report

func (*Report) AddErrNum

func (r *Report) AddErrNum()

func (*Report) Cal

func (r *Report) Cal(now time.Time, resp *Response)

func (*Report) SetDuration

func (r *Report) SetDuration(t time.Duration)

func (*Report) StartReport

func (r *Report) StartReport()

func (*Report) Wait

func (r *Report) Wait()

type Response

type Response struct {
	StatusCode int         `json:"status_code"`
	Err        string      `json:"err"`
	Body       []byte      `json:"body"`
	Status     string      `json:"status"`
	Proto      string      `json:"proto"`
	Header     http.Header `json:"header"`
	Req        *http.Request
}

func ExecSlice

func ExecSlice(cmd []string) (*Response, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL