desktop

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClientBackend = newRawClient(dialBackend)
View Source
var Paths = sync.OnceValue(func() DockerDesktopPaths {
	desktopPaths, err := getDockerDesktopPaths()
	if err != nil {
		panic(err)
	}

	return desktopPaths
})

Functions

func AvoidResourceSaverMode

func AvoidResourceSaverMode(ctx context.Context)

func CheckDesktopIsRunning added in v0.33.0

func CheckDesktopIsRunning(ctx context.Context) error

func CheckFeatureFlagIsEnabled added in v0.35.0

func CheckFeatureFlagIsEnabled(ctx context.Context, featureName string) (bool, error)

func CheckFeatureIsEnabled

func CheckFeatureIsEnabled(ctx context.Context, settingName string, label string) error

CheckFeatureIsEnabled verifies if a feature is enabled in either admin-settings.json or Docker Desktop settings. settingName is the setting name (e.g. "enableDockerMCPToolkit", "enableDockerAI", etc.) label is the human-readable name of the feature for error messages

Types

type AuthResponse

type AuthResponse struct {
	AuthType   string `json:"authType,omitempty"`
	BrowserURL string `json:"browserUrl,omitempty"`
}

type DCRClient

type DCRClient struct {
	State                 string `json:"state"`
	ServerName            string `json:"serverName"`
	ProviderName          string `json:"providerName"`
	ClientID              string `json:"clientId"`
	ClientName            string `json:"clientName,omitempty"`
	RegisteredAt          string `json:"registeredAt"` // ISO timestamp
	AuthorizationServer   string `json:"authorizationServer,omitempty"`
	AuthorizationEndpoint string `json:"authorizationEndpoint,omitempty"`
	TokenEndpoint         string `json:"tokenEndpoint,omitempty"`
}

type DockerDesktopPaths

type DockerDesktopPaths struct {
	AdminSettingPath     string
	BackendSocket        string
	RawDockerSocket      string
	JFSSocket            string
	ToolsSocket          string
	CredentialHelperPath func() string
}

type Feature

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

type OAuthApp

type OAuthApp struct {
	App        string        `json:"app"`
	Authorized bool          `json:"authorized"`
	Provider   string        `json:"provider"`
	Scopes     []OAuthScopes `json:"scopes,omitempty"`
	Tools      []string      `json:"tools"`
}

type OAuthScopes

type OAuthScopes struct {
	Description string   `json:"description,omitempty"`
	Metadata    []string `json:"metadata,omitempty"`
	Name        string   `json:"name,omitempty"`
}

type RawClient

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

func (*RawClient) Delete

func (c *RawClient) Delete(ctx context.Context, endpoint string) error

func (*RawClient) Get

func (c *RawClient) Get(ctx context.Context, endpoint string, v any) error

func (*RawClient) Post

func (c *RawClient) Post(ctx context.Context, endpoint string, v any, result any) error

type RegisterDCRRequest

type RegisterDCRRequest struct {
	ClientID              string `json:"clientId"`
	ProviderName          string `json:"providerName"`
	ClientName            string `json:"clientName,omitempty"`
	AuthorizationServer   string `json:"authorizationServer,omitempty"`
	AuthorizationEndpoint string `json:"authorizationEndpoint,omitempty"`
	TokenEndpoint         string `json:"tokenEndpoint,omitempty"`
	ResourceURL           string `json:"resourceUrl,omitempty"`
}

type Secret

type Secret struct {
	Name     string `json:"name"`
	Provider string `json:"provider,omitempty"`
	Value    string `json:"value"`
}

type Secrets

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

func NewSecretsClient

func NewSecretsClient() *Secrets

func (*Secrets) DeleteJfsSecret

func (c *Secrets) DeleteJfsSecret(ctx context.Context, secret string) error

func (*Secrets) GetJfsPolicy

func (c *Secrets) GetJfsPolicy(ctx context.Context) (string, error)

func (*Secrets) ListJfsSecrets

func (c *Secrets) ListJfsSecrets(ctx context.Context) ([]StoredSecret, error)

func (*Secrets) SetJfsPolicy

func (c *Secrets) SetJfsPolicy(ctx context.Context, body string) error

func (*Secrets) SetJfsSecret

func (c *Secrets) SetJfsSecret(ctx context.Context, secret Secret) error

type StoredSecret

type StoredSecret struct {
	Name     string `json:"name"`
	Provider string `json:"provider,omitempty"`
}

type Tools

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

func NewAuthClient

func NewAuthClient() *Tools

func (*Tools) DeleteDCRClient

func (c *Tools) DeleteDCRClient(ctx context.Context, app string) error

func (*Tools) DeleteOAuthApp

func (c *Tools) DeleteOAuthApp(ctx context.Context, app string) error

func (*Tools) GetDCRClient

func (c *Tools) GetDCRClient(ctx context.Context, app string) (*DCRClient, error)

func (*Tools) GetOAuthApp added in v0.22.0

func (c *Tools) GetOAuthApp(ctx context.Context, app string) (*OAuthApp, error)

func (*Tools) ListOAuthApps

func (c *Tools) ListOAuthApps(ctx context.Context) ([]OAuthApp, error)

func (*Tools) PostOAuthApp

func (c *Tools) PostOAuthApp(ctx context.Context, app, scopes string, disableAutoOpen bool) (AuthResponse, error)

func (*Tools) RegisterDCRClient

func (c *Tools) RegisterDCRClient(ctx context.Context, app string, req RegisterDCRRequest) error

func (*Tools) RegisterDCRClientPending

func (c *Tools) RegisterDCRClientPending(ctx context.Context, app string, req RegisterDCRRequest) error

RegisterDCRClientPending registers a provider for lazy DCR setup using state=unregistered

Jump to

Keyboard shortcuts

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