Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) Close() error
- func (c *Client) Endpoint() string
- func (c *Client) FeatureFlags(ctx context.Context) (FeatureFlagResponse, error)
- func (c *Client) IsFeatureEnabled(ctx context.Context, feature string) (bool, error)
- func (c *Client) Ping(ctx context.Context) (*PingResponse, error)
- func (c *Client) Settings(ctx context.Context) (*SettingsResponse, error)
- type DesktopSettings
- type FeatureFlagResponse
- type FeatureFlagValue
- type PingResponse
- type SettingValue
- type SettingsResponse
Constants ¶
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).
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 ¶
NewClient creates a Desktop integration client for the provided in-memory socket address (AF_UNIX or named pipe).
func (*Client) FeatureFlags ¶
func (c *Client) FeatureFlags(ctx context.Context) (FeatureFlagResponse, error)
func (*Client) IsFeatureEnabled ¶ added in v5.1.3
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.
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
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.