Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultIDGererator() string
- type Addon
- type Preset
- type Request
- func (r *Request) AddHeader(name string, value string)
- func (r *Request) AsyncExecute(callback func(error))
- func (r *Request) DelHeader(name string)
- func (r *Request) ExecuteStauts() int
- func (r *Request) FinishedAt() int64
- func (r *Request) GetBody() []byte
- func (r *Request) GetHeader(name string) string
- func (r *Request) GetID() string
- func (r *Request) GetMethod() string
- func (r *Request) GetProxy() string
- func (r *Request) GetURL() string
- func (r *Request) HeaderFields() []string
- func (r *Request) HeaderValues(name string) []string
- func (r *Request) MustExecute()
- func (r *Request) ResetHeader()
- func (r *Request) ResponseBody() []byte
- func (r *Request) ResponseHeader(name string) string
- func (r *Request) ResponseHeaderFields() []string
- func (r *Request) ResponseHeaderValues(name string) []string
- func (r *Request) ResponseStatusCode() int
- func (r *Request) SetBody(body []byte)
- func (r *Request) SetHeader(name string, value string)
- func (r *Request) SetMethod(method string)
- func (r *Request) SetProxy(p string)
- func (r *Request) SetURL(url string)
- type Response
Constants ¶
View Source
const Permission = "http"
View Source
const StatusExecuting = int(1)
View Source
const StatusFail = int(3)
View Source
const StatusReady = int(0)
View Source
const StatusSuccess = int(2)
Variables ¶
View Source
var ErrRequestExecuted = errors.New("httpplugin: request executed")
View Source
var ErrRequestNotExecuted = errors.New("httpplugin: request not executed")
Functions ¶
func DefaultIDGererator ¶
func DefaultIDGererator() string
Types ¶
type Addon ¶
type Addon struct { IDGenerator func() string Client *http.Client Permission string Plugin herbplugin.Plugin }
func Create ¶
func Create(p herbplugin.Plugin) *Addon
type Request ¶
type Request struct { ID string Preset *Preset Status int Response *Response // contains filtered or unexported fields }
func (*Request) AsyncExecute ¶
func (*Request) ExecuteStauts ¶
func (*Request) FinishedAt ¶
func (*Request) HeaderFields ¶
func (*Request) HeaderValues ¶
func (*Request) MustExecute ¶
func (r *Request) MustExecute()
func (*Request) ResetHeader ¶
func (r *Request) ResetHeader()
func (*Request) ResponseBody ¶
func (*Request) ResponseHeader ¶
func (*Request) ResponseHeaderFields ¶
func (*Request) ResponseHeaderValues ¶
func (*Request) ResponseStatusCode ¶
Click to show internal directories.
Click to hide internal directories.