Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CoderInputAnswer = map[string]string{"status": "ok"}
CoderInputAnswer is what a successful input POST answers. The local API client requires a JSON object on every 2xx (internal/localapi), so a plain text answer here would make `coder-send-prompt` and `coder-send-control-keys` report a delivered input as an error. The CLI test replays exactly this value instead of inventing an answer, so the two cannot drift apart.
Functions ¶
func NewProjectChanged ¶
NewProjectChanged is what a plugin's Project.Changed runs: the same projects event NewProjectCreator publishes, so every open list pulls the project's fresh state. It cannot fail today, the error is the facade's room to grow.
func NewProjectCreator ¶
func NewProjectCreator(projects *project.Repository, bus *eventbus.Bus) func(ctx context.Context, name string) (string, error)
NewProjectCreator is the one project creation path of the cockpit: the repository makes the directory (or adopts an existing empty one, see project.Repository.Create), the projects event tells every open page. The projects page handler runs it, and so does the plugin package's Projects facade, which is what makes a project created by a plugin exactly a project created on the page. A name whose directory holds content answers plugin.ErrProjectExists, the one sentinel both surfaces word their refusal from. It stands apart from the Server because the plugins configure before the server is built, on the same bus the server is then given.
Types ¶
type AlphaNumDashString ¶
type AlphaNumDashString string
AlphaNumDashString normalizes user-entered slug fields during Gin form binding.
func (AlphaNumDashString) String ¶
func (s AlphaNumDashString) String() string
func (*AlphaNumDashString) UnmarshalParam ¶
func (s *AlphaNumDashString) UnmarshalParam(value string) error
type CheckboxBool ¶
type CheckboxBool bool
CheckboxBool accepts browser checkbox values during Gin form binding.
func (CheckboxBool) Bool ¶
func (b CheckboxBool) Bool() bool
func (*CheckboxBool) UnmarshalParam ¶
func (b *CheckboxBool) UnmarshalParam(value string) error
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server wires HTTP handling against the domain services.
func NewServer ¶
func NewServer(cfg config.Config, coders []*coder.Manager, shells *shell.Shells, conversations *assistant.Service, workspace *assistant.Workspace, watcher *assistant.Watcher, projects *project.Repository, notifier *notify.Service, settingsStore *settings.Store, pusher *push.Service, restorer *restore.Service, backups *backup.Service, dockerService *docker.Service, intel *editorintelligence.Service, voiceService *voice.Service, plugins []*pluginhost.Serve, bus *eventbus.Bus, version, updateFeedURL, updateFeedFormat string, devBuild bool) (*Server, error)
NewServer constructs a Server serving the given coders. bus is the app wide event stream; it is built by the caller because the plugins configure before this server exists, against the same bus.
func (*Server) LocalHandler ¶
LocalHandler serves the same routes for callers on this machine, over the socket in the state directory (see internal/localapi). Reaching that socket is the whole credential: it lives in a directory only the owner of this process may enter, so a caller that can open it is already allowed to change what the cockpit holds. The request is marked here, at the door, and that marker is what the session check and the CSRF check read.
func (*Server) PublishConversations ¶
func (s *Server) PublishConversations()
PublishConversations announces a coarse change of the conversation list. Individual answer deltas never travel this bus, they belong to the conversation's own stream.
func (*Server) ResumeProjectDeletes ¶
func (s *Server) ResumeProjectDeletes()
ResumeProjectDeletes takes up the deletions the last process was in the middle of. Their rows already say they are working, that was read before this server answered anything; this is the work behind them starting again.
It waits for the docker connection first: the deletion's whole point is that the containers go before the directory does, and a cache that has not answered yet would look exactly like a host without docker. A host that really has none is not waited out for long.
func (*Server) SetAskpass ¶
SetAskpass wires the bridge a user-triggered git action may ask the browser through. Without it every prompt keeps failing fast. The broker's change hook becomes the gitprompt event, which is how a parked, answered or expired question reaches every open page at once, and it keeps the notification center in step, which is how a question reaches somebody with no page open at all.
The boot sweep marks every unread git question entry read first: the broker's questions live in memory, so after a restart none stands, and an entry a killed process left unread would claim a question forever.
Source Files
¶
- auth.go
- coders.go
- commitdrafts.go
- editorgit.go
- editorsettings.go
- errors.go
- form.go
- handlers_agents.go
- handlers_assistant.go
- handlers_backup.go
- handlers_coders.go
- handlers_docker.go
- handlers_docs.go
- handlers_editor.go
- handlers_editor_comments.go
- handlers_editor_lsp.go
- handlers_instructions.go
- handlers_notifications.go
- handlers_projectgit.go
- handlers_projects.go
- handlers_push.go
- handlers_settings.go
- handlers_shells.go
- handlers_skills.go
- handlers_splits.go
- handlers_stream.go
- handlers_update.go
- handlers_voice.go
- linecomments.go
- loginlimiter.go
- markdown.go
- notrunning.go
- projectdelete.go
- projectnav.go
- quicknav.go
- response.go
- router.go
- server.go
- splitlayout.go
- static_assets.go
- terminaltabs.go
- terminaltheme.go