16 lines
336 B
Go
16 lines
336 B
Go
package api
|
|
|
|
import "net/http"
|
|
|
|
type apiTransport struct {
|
|
clientId string
|
|
}
|
|
|
|
var _ http.RoundTripper = (*apiTransport)(nil)
|
|
|
|
// RoundTrip implements http.RoundTripper.
|
|
func (a *apiTransport) RoundTrip(req *http.Request) (*http.Response, error) {
|
|
req.Header.Add("Client-ID", a.clientId)
|
|
return http.DefaultTransport.RoundTrip(req)
|
|
}
|