canonical / gomaasclient

Go MAAS client
Apache License 2.0
23 stars 28 forks source link

Add constructor with pluggable transport #55

Closed Sovietaced closed 9 months ago

Sovietaced commented 10 months ago

This pull adds a new constructor function that takes in an http.Transport. This would allow users to pass in instrumented transports to support observability efforts and trace API requests to the MAAS backend.

I think a move towards a builder / option pattern would be more elegant here but I'm keeping my changes minimal.

Fixes https://github.com/maas/gomaasclient/issues/32

Sovietaced commented 10 months ago

This should use http.RoundTripper I think, will fix later today.