Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(info auth.CreateAuthInfo, middleware ...OutboundMiddleware) *http.Client
New creates an http.Client that includes 2 extra outbound middleware: tracing and auth they are going to be applied in following order: tracing, auth, remaining outbound middleware and only if all of them passed the request is going to be send. Client is safe to use by multiple go routines, if global tracer is not changed.
Types ¶
type Executor ¶
Executor executes the http request. Execute must be safe to use by multiple go routines
type OutboundMiddleware ¶
type OutboundMiddleware interface {
Handle(r *http.Request, next Executor) (resp *http.Response, err error)
}
OutboundMiddleware applies outbound middleware on client requests and such as adding tracing to request's context. Outbound middleware must call next.Execute() at most once, calling it twice and more will lead to an undefined behavior
type OutboundMiddlewareFunc ¶
OutboundMiddlewareFunc is an adaptor to call normal functions to apply outbound middleware.