Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildUrl ¶
func BuildUrl(req *HttpRequest) string
Types ¶
type HttpHeader ¶
type HttpInvoker ¶
type HttpInvoker interface {
Do(req *HttpRequest, interceptors ...Interceptor) (res *HttpResponse, err error)
}
type HttpInvokerImpl ¶
type HttpInvokerImpl struct {
// contains filtered or unexported fields
}
func NewHttpInvoker ¶
func NewHttpInvoker(opts *HttpInvokerOptions) (c *HttpInvokerImpl, err error)
func (*HttpInvokerImpl) Do ¶
func (c *HttpInvokerImpl) Do(req *HttpRequest, interceptors ...Interceptor) (*HttpResponse, error)
type HttpInvokerOptions ¶
type HttpInvokerOptions struct {
PDP string
}
type HttpRequest ¶
type HttpRequest struct {
Method string `yaml:"method,omitempty" json:"method"`
Url string `yaml:"url,omitempty" json:"url"`
PDP string `yaml:"pdp,omitempty" json:"pdp"`
Path string `yaml:"path,omitempty" json:"path"`
Headers []HttpHeader `yaml:"headers,omitempty" json:"headers"`
Body string `yaml:"body,omitempty" json:"body"`
Timeout *string `yaml:"timeout,omitempty" json:"timeout"`
// contains filtered or unexported fields
}
func (*HttpRequest) GetRawRequest ¶
func (r *HttpRequest) GetRawRequest() (req *http.Request, err error)
type HttpResponse ¶
type HttpResponse struct {
Status string
StatusCode int
Version string
Header http.Header
ContentLength int64
Body []byte
// contains filtered or unexported fields
}
func NewHttpResponse ¶
func NewHttpResponse(lowRes *http.Response) (res *HttpResponse, err error)
func (*HttpResponse) GetRawResponse ¶
func (r *HttpResponse) GetRawResponse() (res *http.Response, err error)
type Interceptor ¶
type Interceptor interface{}
type PostProcessor ¶
type PostProcessor interface {
Interceptor
PostProcess(req *HttpRequest, res *HttpResponse) error
}
type PreProcessor ¶
type PreProcessor interface {
Interceptor
PreProcess(req *HttpRequest) error
}
Click to show internal directories.
Click to hide internal directories.