http

package
v13.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTraceRoundTripper added in v1.9.0

func NewTraceRoundTripper(inner http.RoundTripper, tc *trace.Client, prefix string) http.RoundTripper

func PostHelper

func PostHelper(ctx context.Context, httpClient *http.Client, tc *trace.Client, method string, endpoint string, bodyObject interface{}, action string, compress bool, extraTags map[string]string, log *logrus.Logger) error

PostHelper is shared code for POSTing to an endpoint, that consumes JSON, is zlib- compressed, that returns 202 on success, that has a small response action as a string used for statsd metric names and log messages emitted from this function - probably a static string for each callsite you can disable compression with compress=false for endpoints that don't support it

Types

type TraceRoundTripper added in v1.9.0

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

func (*TraceRoundTripper) RoundTrip added in v1.9.0

func (tripper *TraceRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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