Help us shape the future of Go! Take the 2026 Go Developer Survey

desktop

package
v5.1.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const EngineLabel = "com.docker.desktop.address"

EngineLabel is used to detect that Compose is running with a Docker Desktop context. When present, the value is an endpoint address for an in-memory socket (AF_UNIX or named pipe).

View Source
const FeatureLogsTab = "LogsTab"

FeatureLogsTab is the feature flag name for the Docker Desktop Logs view.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client for integration with Docker Desktop features.

func NewClient

func NewClient(apiEndpoint string) *Client

NewClient creates a Desktop integration client for the provided in-memory socket address (AF_UNIX or named pipe).

func (*Client) Close

func (c *Client) Close() error

Close releases any open connections.

func (*Client) Endpoint

func (c *Client) Endpoint() string

func (*Client) FeatureFlags

func (c *Client) FeatureFlags(ctx context.Context) (FeatureFlagResponse, error)

func (*Client) IsFeatureEnabled added in v5.1.3

func (c *Client) IsFeatureEnabled(ctx context.Context, feature string) (bool, error)

IsFeatureEnabled checks both the feature flag (GET /features) and the user setting (GET /app/settings) for a given feature. Returns true only when the feature is both rolled out and enabled by the user. Features without a corresponding setting entry are considered enabled if the flag is set.

func (*Client) Ping

func (c *Client) Ping(ctx context.Context) (*PingResponse, error)

Ping is a minimal API used to ensure that the server is available.

func (*Client) Settings added in v5.1.3

func (c *Client) Settings(ctx context.Context) (*SettingsResponse, error)

Settings fetches the Docker Desktop application settings.

type DesktopSettings added in v5.1.3

type DesktopSettings struct {
	EnableLogsTab SettingValue `json:"enableLogsTab"`
}

DesktopSettings represents the "desktop" section of Docker Desktop settings.

type FeatureFlagResponse

type FeatureFlagResponse map[string]FeatureFlagValue

type FeatureFlagValue

type FeatureFlagValue struct {
	Enabled bool `json:"enabled"`
}

type PingResponse

type PingResponse struct {
	ServerTime int64 `json:"serverTime"`
}

type SettingValue added in v5.1.3

type SettingValue struct {
	Locked bool `json:"locked"`
	Value  bool `json:"value"`
}

SettingValue represents a Docker Desktop setting with a locked flag and a value.

type SettingsResponse added in v5.1.3

type SettingsResponse struct {
	Desktop DesktopSettings `json:"desktop"`
}

SettingsResponse represents the Docker Desktop settings response.

Jump to

Keyboard shortcuts

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