Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/ide-service-api/go/config/ideconfig.go
2500 views
1
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package config
6
7
type IDEType string
8
9
const (
10
IDETypeBrowser IDEType = "browser"
11
IDETypeDesktop IDEType = "desktop"
12
)
13
14
type IDEConfig struct {
15
SupervisorImage string `json:"supervisorImage"`
16
IdeOptions IDEOptions `json:"ideOptions"`
17
}
18
19
type IDEOptions struct {
20
// Options is a list of available IDEs.
21
Options map[string]IDEOption `json:"options"`
22
// DefaultIde when the user has not specified one.
23
DefaultIde string `json:"defaultIde"`
24
// DefaultDesktopIde when the user has not specified one.
25
DefaultDesktopIde string `json:"defaultDesktopIde"`
26
// Clients specific IDE options.
27
Clients map[string]IDEClient `json:"clients"`
28
}
29
30
type IDEOption struct {
31
// OrderKey to ensure a stable order one can set an `orderKey`.
32
OrderKey string `json:"orderKey,omitempty"`
33
// Title with human readable text of the IDE (plain text only).
34
Title string `json:"title"`
35
// Type of the IDE, currently 'browser' or 'desktop'.
36
Type IDEType `json:"type"`
37
// Logo URL for the IDE. See also components/ide-proxy/static/image/ide-log/ folder
38
Logo string `json:"logo"`
39
// Tooltip plain text only
40
Tooltip string `json:"tooltip,omitempty"`
41
// Label is next to the IDE option like “Browser” (plain text only).
42
Label string `json:"label,omitempty"`
43
// Notes to the IDE option that are rendered in the preferences when a user chooses this IDE.
44
Notes []string `json:"notes,omitempty"`
45
// Hidden this IDE option is not visible in the IDE preferences.
46
Hidden bool `json:"hidden,omitempty"`
47
// Experimental this IDE option is to only be shown to some users
48
Experimental bool `json:"experimental,omitempty"`
49
// Image ref to the IDE image.
50
Image string `json:"image"`
51
// LatestImage ref to the IDE image, this image ref always resolve to digest.
52
LatestImage string `json:"latestImage,omitempty"`
53
// ResolveImageDigest when this is `true`, the tag of this image is resolved to the latest image digest regularly.
54
// This is useful if this image points to a tag like `nightly` that will be updated regularly. When `resolveImageDigest` is `true`, we make sure that we resolve the tag regularly to the most recent image version.
55
ResolveImageDigest bool `json:"resolveImageDigest,omitempty"`
56
// PluginImage ref for the IDE image, this image ref always resolve to digest.
57
// DEPRECATED use ImageLayers instead
58
PluginImage string `json:"pluginImage,omitempty"`
59
// PluginLatestImage ref for the latest IDE image, this image ref always resolve to digest.
60
// DEPRECATED use LatestImageLayers instead
61
PluginLatestImage string `json:"pluginLatestImage,omitempty"`
62
// ImageVersion the semantic version of the IDE image.
63
ImageVersion string `json:"imageVersion,omitempty"`
64
// LatestImageVersion the semantic version of the latest IDE image.
65
LatestImageVersion string `json:"latestImageVersion,omitempty"`
66
// ImageLayers for additional ide layers and dependencies
67
ImageLayers []string `json:"imageLayers,omitempty"`
68
// LatestImageLayers for latest additional ide layers and dependencies
69
LatestImageLayers []string `json:"latestImageLayers,omitempty"`
70
// AllowPin if the editor is allowed to pin versions, only used for `ide-service` internal computation.
71
AllowPin bool `json:"allowPin,omitempty"`
72
// Release Versions of the IDE
73
Versions []IDEVersion `json:"versions,omitempty"`
74
}
75
76
type IDEVersion struct {
77
Version string `json:"version"`
78
// Image ref to the IDE image.
79
Image string `json:"image"`
80
// ImageLayers for additional ide layers and dependencies
81
ImageLayers []string `json:"imageLayers,omitempty"`
82
}
83
84
type IDEClient struct {
85
// DefaultDesktopIDE when the user has not specified one.
86
DefaultDesktopIDE string `json:"defaultDesktopIDE,omitempty"`
87
// DesktopIDEs supported by the client.
88
DesktopIDEs []string `json:"desktopIDEs,omitempty"`
89
// InstallationSteps to install the client on user machine.
90
InstallationSteps []string `json:"installationSteps,omitempty"`
91
}
92
93