Documentation ¶
Index ¶
- Variables
- type Instance
- func (c *Instance) Delete(ctx context.Context, url string, body io.Reader) (serializer.Serializer, error)
- func (c *Instance) Get(ctx context.Context, url string) (serializer.Serializer, error)
- func (c *Instance) Post(ctx context.Context, url string, body io.Reader) (serializer.Serializer, error)
- func (c *Instance) PostFile(ctx context.Context, url string, files map[string]string, ...) (serializer.Serializer, error)
- func (c *Instance) Put(ctx context.Context, url string, body io.Reader) (serializer.Serializer, error)
- func (c *Instance) ReadResponse(resp *http.Response) (serializer.Serializer, error)
- func (c *Instance) Send(ctx context.Context, request *http.Request) (serializer.Serializer, error)
- func (c *Instance) WithHttpClient(httpClient *http.Client) *Instance
- func (c *Instance) WithTracer(tracer *jaeger.Tracer) *Instance
Constants ¶
This section is empty.
Variables ¶
View Source
var (
EmptyResponse = errors.New("empty response")
)
Functions ¶
This section is empty.
Types ¶
type Instance ¶ added in v1.1.7
type Instance struct {
// contains filtered or unexported fields
}
Instance simple wrapper of http.Client
func (*Instance) Delete ¶ added in v1.1.7
func (c *Instance) Delete(ctx context.Context, url string, body io.Reader) (serializer.Serializer, error)
Delete send delete request
func (*Instance) Get ¶ added in v1.1.7
func (c *Instance) Get(ctx context.Context, url string) (serializer.Serializer, error)
Get send get request
func (*Instance) Post ¶ added in v1.1.7
func (c *Instance) Post(ctx context.Context, url string, body io.Reader) (serializer.Serializer, error)
Post send post request
func (*Instance) PostFile ¶ added in v1.1.7
func (c *Instance) PostFile(ctx context.Context, url string, files map[string]string, params map[string]string) (serializer.Serializer, error)
PostFile send post request with file
func (*Instance) Put ¶ added in v1.1.7
func (c *Instance) Put(ctx context.Context, url string, body io.Reader) (serializer.Serializer, error)
Put send put request
func (*Instance) ReadResponse ¶ added in v1.1.7
func (c *Instance) ReadResponse(resp *http.Response) (serializer.Serializer, error)
ReadResponse reads body from the *http.Response
func (*Instance) Send ¶ added in v1.1.7
func (c *Instance) Send(ctx context.Context, request *http.Request) (serializer.Serializer, error)
Send return Response by http.Request
func (*Instance) WithHttpClient ¶ added in v1.1.7
WithHttpClient sets the http client
Click to show internal directories.
Click to hide internal directories.