Documentation
¶
Overview ¶
Package transport provides an HTTP transport that routes requests through the Docker Desktop proxy when available. It lives in its own leaf package so callers that only need the transport don't pull the OCI registry stack that pkg/remote depends on.
Index ¶
- func DesktopRunning(ctx context.Context) (bool, error)
- func New(ctx context.Context) http.RoundTripper
- func NewDesktopTransport(direct http.RoundTripper) http.RoundTripper
- func NewWithDirectTransport(ctx context.Context, direct http.RoundTripper) http.RoundTripper
- func SetDesktopRunningForTest(detect func(context.Context) (bool, error)) func()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DesktopRunning ¶ added in v1.127.0
DesktopRunning reports Docker Desktop availability. It returns the most recent value while an expired value is refreshed in the background.
func New ¶
func New(ctx context.Context) http.RoundTripper
New returns an HTTP transport that uses the Docker Desktop proxy if available, and falls back to direct connections while re-probing the proxy after a cooldown so long-lived processes recover on their own.
func NewDesktopTransport ¶ added in v1.127.0
func NewDesktopTransport(direct http.RoundTripper) http.RoundTripper
NewDesktopTransport returns a Docker Desktop proxy transport with direct fallback. A nil direct uses http.DefaultTransport.
func NewWithDirectTransport ¶ added in v1.127.0
func NewWithDirectTransport(ctx context.Context, direct http.RoundTripper) http.RoundTripper
NewWithDirectTransport is like New but uses direct as its direct fallback. A nil direct uses http.DefaultTransport.
Types ¶
This section is empty.