package desktop
import "github.com/docker/compose/v2/internal/desktop"
Index ¶
- func RemoveFileSharesForProject(ctx context.Context, c *Client, projectName string)
- type Client
- func NewClient(apiEndpoint string) *Client
- func NewFromDockerClient(ctx context.Context, dockerCli command.Cli) (*Client, error)
- func (c *Client) Close() error
- func (c *Client) CreateFileShare(ctx context.Context, r CreateFileShareRequest) (*CreateFileShareResponse, error)
- func (c *Client) DeleteFileShare(ctx context.Context, id string) error
- func (c *Client) Endpoint() string
- func (c *Client) FeatureFlags(ctx context.Context) (FeatureFlagResponse, error)
- func (c *Client) GetFileSharesConfig(ctx context.Context) (*GetFileSharesConfigResponse, error)
- func (c *Client) ListFileShares(ctx context.Context) ([]FileShareSession, error)
- func (c *Client) Ping(ctx context.Context) (*PingResponse, error)
- func (c *Client) StreamFileShares(ctx context.Context) (<-chan EventMessage[[]FileShareSession], error)
- type CreateFileShareRequest
- type CreateFileShareResponse
- type EventMessage
- type FeatureFlagResponse
- type FeatureFlagValue
- type FileShareEndpoint
- type FileShareManager
- func NewFileShareManager(cli *Client, projectName string, hostPaths []string) *FileShareManager
- func (m *FileShareManager) EnsureExists(ctx context.Context) (err error)
- type FileShareReceiverState
- type FileShareSession
- type GetFileSharesConfigResponse
- type PingResponse
Functions ¶
func RemoveFileSharesForProject ¶
RemoveFileSharesForProject removes any Synchronized File Shares that were created by Compose for this project in the past if possible.
Errors are not propagated; they are only sent to the progress writer.
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 NewFromDockerClient ¶
NewFromDockerClient creates a Desktop Client using the Docker CLI client to auto-discover the Desktop CLI socket endpoint (if available).
An error is returned if there is a failure communicating with Docker Desktop, but even on success, a nil Client can be returned if the active Docker Engine is not a Desktop instance.
func (*Client) Close ¶
Close releases any open connections.
func (*Client) CreateFileShare ¶
func (c *Client) CreateFileShare(ctx context.Context, r CreateFileShareRequest) (*CreateFileShareResponse, error)
func (*Client) DeleteFileShare ¶
func (*Client) Endpoint ¶
func (*Client) FeatureFlags ¶
func (c *Client) FeatureFlags(ctx context.Context) (FeatureFlagResponse, error)
func (*Client) GetFileSharesConfig ¶
func (c *Client) GetFileSharesConfig(ctx context.Context) (*GetFileSharesConfigResponse, error)
func (*Client) ListFileShares ¶
func (c *Client) ListFileShares(ctx context.Context) ([]FileShareSession, error)
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) StreamFileShares ¶
func (c *Client) StreamFileShares(ctx context.Context) (<-chan EventMessage[[]FileShareSession], error)
type CreateFileShareRequest ¶
type CreateFileShareRequest struct { string `json:"hostPath"` map[string]string `json:"labels,omitempty"` }
type CreateFileShareResponse ¶
type CreateFileShareResponse struct { string `json:"fileShareID"` }
type EventMessage ¶
type FeatureFlagResponse ¶
type FeatureFlagResponse map[string]FeatureFlagValue
type FeatureFlagValue ¶
type FeatureFlagValue struct { Enabled bool `json:"enabled"` }
type FileShareEndpoint ¶
type FileShareEndpoint struct { string `json:"path"` uint64 `json:"totalFileSize,omitempty"` *FileShareReceiverState `json:"stagingProgress"` }
type FileShareManager ¶
type FileShareManager struct {
// contains filtered or unexported fields
}
FileShareManager maps between Compose bind mounts and Desktop File Shares state.
func NewFileShareManager ¶
func NewFileShareManager(cli *Client, projectName string, hostPaths []string) *FileShareManager
func (*FileShareManager) EnsureExists ¶
func (m *FileShareManager) EnsureExists(ctx context.Context) (err error)
EnsureExists looks for existing File Shares or creates new ones for the host paths.
This function blocks until each share reaches steady state, at which point flow can continue.
type FileShareReceiverState ¶
type FileShareReceiverState struct { uint64 `json:"totalReceivedSize"` }
type FileShareSession ¶
type FileShareSession struct { string `json:"identifier"` FileShareEndpoint `json:"alpha"` FileShareEndpoint `json:"beta"` map[string]string `json:"labels"` string `json:"status"` }
type GetFileSharesConfigResponse ¶
type GetFileSharesConfigResponse struct { bool `json:"active"` struct { ManageBindMounts bool `json:"manageBindMounts"` } }
type PingResponse ¶
type PingResponse struct { ServerTime int64 `json:"serverTime"` }
Source Files ¶
client.go discovery.go file_shares.go
- Version
- v2.35.1 (latest)
- Published
- Apr 17, 2025
- Platform
- linux/amd64
- Imports
- 21 packages
- Last checked
- 3 hours ago –
Tools for package owners.