Documentation
¶
Overview ¶
Package workspace mounts additional gadak profiles under /w/<name>/ and lists them at GET /api/v1/workspaces. Shared by `gadak serve` and the desktop app.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListHandler ¶
func ListHandler() http.HandlerFunc
ListHandler answers GET /api/v1/workspaces with the primary profile first (active:true) and every named profile after. Credentials never appear.
func ProfileExists ¶
ProfileExists reports whether name is a directory under profiles/ (disk is the source of truth for workspace mounts).
Types ¶
type ListEntry ¶
type ListEntry struct {
Name string `json:"name"`
Site string `json:"site,omitempty"`
Projects []string `json:"projects,omitempty"`
Active bool `json:"active,omitempty"`
Error string `json:"error,omitempty"`
}
ListEntry is one item in GET /api/v1/workspaces. Never carries Token or Email — only site URL and project keys for the picker.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry lazy-opens profile mirrors on first /w/<name>/ request and closes them when the process exits.
func (*Registry) Close ¶
func (r *Registry) Close()
Close closes every opened workspace DB. Safe to call once at shutdown.
func (*Registry) Handler ¶
Handler routes /w/<name>/… to the named profile's API, config, healthz, or SPA. Invalid names and unknown profiles answer 404. version is reported in healthz (same field as the primary /healthz).