transport

package
v1.127.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func DesktopRunning added in v1.127.0

func DesktopRunning(ctx context.Context) (bool, error)

DesktopRunning reports Docker Desktop availability. It returns the most recent value while an expired value is refreshed in the background.

func New

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.

func SetDesktopRunningForTest added in v1.127.0

func SetDesktopRunningForTest(detect func(context.Context) (bool, error)) func()

SetDesktopRunningForTest overrides Docker Desktop detection and returns a function that restores the previous detector.

Types

This section is empty.

Jump to

Keyboard shortcuts

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