desktop

package
v2.27.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoveFileSharesForProject added in v2.26.0

func RemoveFileSharesForProject(ctx context.Context, c *Client, projectName string)

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

func NewClient(apiEndpoint string) *Client

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

func NewFromDockerClient added in v2.26.0

func NewFromDockerClient(ctx context.Context, dockerCli command.Cli) (*Client, error)

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

func (c *Client) Close() error

Close releases any open connections.

func (*Client) CreateFileShare added in v2.26.0

func (*Client) DeleteFileShare added in v2.26.0

func (c *Client) DeleteFileShare(ctx context.Context, id string) error

func (*Client) Endpoint added in v2.26.0

func (c *Client) Endpoint() string

func (*Client) FeatureFlags added in v2.26.0

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

func (*Client) GetFileSharesConfig added in v2.26.0

func (c *Client) GetFileSharesConfig(ctx context.Context) (*GetFileSharesConfigResponse, error)

func (*Client) ListFileShares added in v2.26.0

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 added in v2.26.0

func (c *Client) StreamFileShares(ctx context.Context) (<-chan EventMessage[[]FileShareSession], error)

type CreateFileShareRequest added in v2.26.0

type CreateFileShareRequest struct {
	HostPath string            `json:"hostPath"`
	Labels   map[string]string `json:"labels,omitempty"`
}

type CreateFileShareResponse added in v2.26.0

type CreateFileShareResponse struct {
	FileShareID string `json:"fileShareID"`
}

type EventMessage added in v2.26.0

type EventMessage[T any] struct {
	Value T
	Error error
}

type FeatureFlagResponse added in v2.26.0

type FeatureFlagResponse map[string]FeatureFlagValue

type FeatureFlagValue added in v2.26.0

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

type FileShareEndpoint added in v2.26.0

type FileShareEndpoint struct {
	Path            string                  `json:"path"`
	TotalFileSize   uint64                  `json:"totalFileSize,omitempty"`
	StagingProgress *FileShareReceiverState `json:"stagingProgress"`
}

type FileShareManager added in v2.26.0

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

FileShareManager maps between Compose bind mounts and Desktop File Shares state.

func NewFileShareManager added in v2.26.0

func NewFileShareManager(cli *Client, projectName string, hostPaths []string) *FileShareManager

func (*FileShareManager) EnsureExists added in v2.26.0

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 added in v2.26.0

type FileShareReceiverState struct {
	TotalReceivedSize uint64 `json:"totalReceivedSize"`
}

type FileShareSession added in v2.26.0

type FileShareSession struct {
	SessionID string            `json:"identifier"`
	Alpha     FileShareEndpoint `json:"alpha"`
	Beta      FileShareEndpoint `json:"beta"`
	Labels    map[string]string `json:"labels"`
	Status    string            `json:"status"`
}

type GetFileSharesConfigResponse added in v2.26.0

type GetFileSharesConfigResponse struct {
	Active  bool `json:"active"`
	Compose struct {
		ManageBindMounts bool `json:"manageBindMounts"`
	}
}

type PingResponse

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

Jump to

Keyboard shortcuts

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