rpc

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: AGPL-3.0 Imports: 23 Imported by: 0

README

core/rpc

The wire: core.Core carried over a connection as newline-delimited JSON, between the TUI and the daemon over the daemon's unix socket, to any number of clients at once. The full frame and method reference is docs/specs/protocol.md, generated from this package; everything logs under subsystem=rpc.

Files

File Holds
rpc.go Frame, Hello, rpc.Protocol, the //go:generate line
build.go rpc.Build, rpc.Self(), rpc.SetVersion, rpc.commitUnix, CompareBuilds, knownExeTime
methods_gen.go generated from core/iface.go by internal/gen: each method's …Params and …Result, the methods table, the server's dispatch, the client's methods
server.go, server_conn.go NewServer, Server, Backend, publishing, the notice backlog, coalesceKey, serverConn
route.go tagReq, local, forConn, routed, reqFor, connBackend
client.go, replica.go Dial, Client, handshake, requestNoErr, the replica
inprocess.go InProcess
seams.go InProcessForTest, FlushForTest

Frames

Each side's first frame is a hello (Hello):

  • protocol: rpc.Protocol, bumped on any incompatible change;
  • build: from debug.ReadBuildInfo (rpc.Build);
  • optional: version (main's release, rpc.SetVersion), time (vcs.time, else the commit time stamped at link time into rpc.commitUnix, which flake.nix sets from self.lastModified, since a Nix build has no VCS information), modified (vcs.modified), exe (the SHA-256 of the running executable, read through /proc/self/exe where there is one, so a rebuild in place doesn't change a running process's answer), exe_time (that file's mtime), and, from a server only, tmux, the tmux server its sessions run on (Server.SetTmux).

rpc.Self() is this binary's hello. The server sends its hello first, even to a peer of another protocol, then answers that peer mismatch, so Dial's *MismatchError carries the server's hello and a newer client can still replace an older daemon.

After the hellos come requests (id, method, params), replies (id, result, error as a core.WireError), casts (a request with no id, which gets no reply), events (event, the event's Go type name, and data) fatal (the model panicked, or the server could not encode an event) and bye (the server is stopping gracefully: {"bye":"stopping"}, under Server below). Request-ID routing is in the reference's "Request IDs" section.

Builds

CompareBuilds (build.go) says which of two hellos is newer: the same exe is the same build; otherwise the higher version (as semver), then the later time, then a modified tree over a clean one, then the higher protocol (a peer that sent none, 0, is older), then, only when both name their commit time, the newer exe_time (a dev build rebuilt at one commit replaces its sandbox's daemon). A field either side lacks decides nothing, and neither does an exe_time at or before 1970-01-01T00:00:01Z (knownExeTime: a Nix store dates every file there). A full tie is the same build, so two installs of one release keep whichever daemon runs, a Nix build and a release binary of one commit keep each other's, and two Nix builds are ordered by their stamped commit times. A build that names no commit (a plain go build from a tarball) at the release of the running daemon keeps it; loom serve stop switches. The policy that acts on it is the TUI's join (daemon_client.go, ../../internal/daemon/README.md).

Generated code

methods_gen.go is generated from core/iface.go by internal/gen (go generate ./core/rpc). It holds each method's …Params (one field per parameter, named after it) and …Result ({"value":…,"ok":…}; an error travels in the reply's error), the methods table with each method's kind, the server's dispatch (which takes a tag func(*core.ReqID) error and calls it on every core.ReqID parameter before the call), and the client's methods. A method's wire name is its Go name.

The generator refuses an rpc: directive in a doc comment, an unknown line comment, and a parameter carrying a ReqID anywhere but as its own type (in a slice, map or pointer, or a field of a core struct, at any depth: nestedReqID, over core's type declarations, which gen.CoreSources reads beside core/iface.go), since dispatch tags only a parameter of type ReqID and a nested one would reach the model as its client numbered it. Tests: TestGenerate_TagsEveryRequestID, TestGenerate_RefusesARequestIDTheServerCannotTag (internal/gen/gen_test.go), TestGenerated_IsFresh (stale methods_gen.go), TestMethods_CoverCore (a Core method missing from the table).

Compatibility: adding a method, an event or an optional field needs no bump (a peer answers a method it lacks with unsupported, ignores a field it does not know, and drops an event it does not know); removing or renaming a method, event or field, or changing what a field means or a frame's shape, needs a Protocol bump (its comment in rpc.go states the rule).

Server

The server (server.go, server_conn.go) serves a Backend (core.Core plus SyncAndSnapshot, SetSelection and Wakes, all of which *core.Loop has) to any number of connections, which it numbers (serverConn.n). It publishes (the backend's Sync, to every connection) after every request and on every loop wake (the loop's hook timer, four times a second, wakes none when a tick changed nothing a client sees: Model.noWake), and queues a request's reply only after that publish, so a request's events reach the client ahead of its reply. rpc.Ping is a request that only publishes and replies: the client's barrier. A cast publishes nothing (pane events cast many times a second per session), and its failure is only logged (server.cast_failed). The server answers rpc:local methods as requests too, for a client without a replica. A peer that sends no hello within helloTimeout is dropped.

A connection is sent its hello, then its snapshot, then the notices no connection was there for. The snapshot comes from one loop call, Loop.SyncAndSnapshot: its Sync's events go to the connections already there and its Snapshot to the new one, so a late joiner's replica starts from the state the next Sync diffs against (TestServe_ALateJoinerStartsFromThePublishedBaseline).

The notice backlog. A Notice published while no client is connected, and those a daemon hands over with Keep (its boot's, raised before any client could be), wait for the next connection; a request's Notice whose client has gone goes to the connections still there, and is kept only when there are none. The backlog keeps the newest maxBacklog and logs each notice it keeps (server.notice_kept), so even one no client reads is on record (server_backlog_test.go).

Queues. Each connection's outbound side is a queue its own writer goroutine drains (serverConn), so a slow client never blocks the server. A state event replaces a queued one of the same kind in place (coalesceKey: workspaces, model, accounts, github, and each workspace's views), so the queue holds at most one of each. Replies and other events are never dropped or reordered, because a resync could not rebuild a lost Reply and a script would hang on it; the non-state queue is unbounded (replies are bounded by the requests in flight).

Panics and close. The server recovers a panic in a call, a Sync or the snapshot: the request's reply carries code panic, a Fatal frame goes to every connection, a later one included, and Server.Fatal() closes (FatalError says why), on which the daemon exits. An event that will not encode is fatal too (CodeProtocol, naming the event, server.encode_event_failed), because dropping it could strand a Reply's requester. The server tracks every connection from Serve on, so Close ends even one that has not said hello, and Serve after Close closes its connection at once. A connection's close waits at most closeFlushTimeout for a peer that never reads.

Stopping. Server.Bye starts a graceful stop. It sends every connection a bye frame (an optional Frame field, so a peer that does not know it decodes past it and the frame matches nothing it reads: no Protocol bump), and from then on the server takes nothing new: handle answers a request unavailable (core.CodeUnavailable, queued after a publish like any reply, so the ping barrier included) without reaching the backend, and drops a cast (server.cast_while_stopping). A connection that joins meanwhile is sent the bye after its snapshot. Bye returns once the calls already let in (Server.calls, counted under the lock while not stopping) have their replies queued, so the Loop.Quiesce the daemon runs next waits on every job those calls started, and their replies still reach their clients as the jobs land. Server.Close then publishes once more (a reply no wake has published yet), flushes each connection in parallel (serverConn.flush) and closes them. A model that failed gets no bye, only the Fatal frame and the close, so its clients take it for a crash (TestBye_ReachesEveryConnection, TestBye_WaitsForTheRepliesOfTheCallsItLetIn, TestBye_TheServerRefusesARequestThatCrossedIt, TestBye_InFlightReplyArrivesBeforeClose, TestBye_AJoinerWhileStoppingFailsToDial).

Routing

Each client numbers its requests itself, from 1 and below 2^32, so request IDs collide across clients. The server keeps them apart without a table: dispatch's tag (tagReq, route.go) ORs the connection's number into the high 32 bits of every request ID it hands the model (0, no Reply wanted, stays 0; an ID at or above 2^32 is a protocol error), and at publish each connection is sent each event as forConn says, with the number masked out again (local): a Reply, and a request's Notice, go to the client that made it alone, with its own ID; Started and Recovered go to every client, since each attaches the session's pane, naming the request (Req) only to the one that made it (reqFor; 0 for every other). A table would leak: a Create's Reply comes at once and its Started much later, so it would never know when to forget an entry. The events reach the right request because the model stamps them (Model.cause). routed lists the events that name a request.

Selection per connection. The server calls a connection's methods through connBackend, whose SetSelected records that connection's selected row (setSelected; 0 forgets it) and hands the model every connection's, in connection order without repeats, through Backend.SetSelection (Loop.SetSelection); a closed connection's is dropped (dropSelection).

Client

Dial (client.go) sends its hello, checks the server's (Peer), starts the reader, and returns after a ping (handshake), by which time the replica (replica.go) holds the snapshot. A fatal frame met during that ping is Dial's error; one landing after it is the client's loss.

The reader handles every frame in the order the server wrote them. It applies each state event to the replica, marking what changed; queues the other events; records a fatal; and hands each reply to the call waiting for it. An unknown event name (a newer peer's) is logged and dropped (client.unknown_event). A known event that fails to decode is fatal (CodeProtocol), since it may be a Reply someone waits for or state the replica would hold stale.

The replica answers every rpc:local query through the state views' methods and hands out copies. It ignores a ViewsChanged for a workspace it does not hold: the server's queue coalesces a WorkspacesChanged in place, so one that drops a workspace can arrive ahead of a ViewsChanged queued for it, which would otherwise bring the dropped workspace's views back for good. Sync hands out the newest state once per kind, in the model's publish order, then the other events in arrival order. Wakes signals arrivals; wakes coalesce, and Close closes the channel once the reader has stopped.

A request returns the method's error (core.FromWire). A request for a method with no error to return logs its failure (requestNoErr, client.request_failed). A reply with code panic or protocol is fatal; an unsupported one is the method's ordinary error. A connection lost without Close is fatal the same way (client.connection_lost). What fatal means depends on the client:

  • a daemon's client (Dial) panics nowhere: it records the loss (Err) and signals Wakes; local reads answer from the last replica, requests are refused at once as unavailable (core.ErrUnavailable, a refusal, its message naming the loss) and casts are dropped, so the TUI can go offline cleanly (TestPanic_ADaemonsClientReportsIt, TestConnectionLost_IsFatal). A loss after the server's bye is a stop, and Err matches core.ErrUnavailable; one without is a crash (TestBye_LossAfterItIsGraceful, TestLoss_WithoutByeIsNot);
  • an in-process client (InProcess, which sets raise) panics with the WireError in the caller, and so does every later call, local reads included (TestInProcess_RaisesTheModelsPanic).

A server that says bye (Stopping) makes the client refuse every request as unavailable without writing it and drop every cast, while replies to the requests in flight still arrive. A request refused as unavailable, by the client or by a server it crossed the bye with, is recorded by its ReqID (noteRefused) and handed out once by TakeRefused: no Reply will ever answer it, and its requester fails it itself (TestBye_ARequestAfterItIsRefusedLocally, TestClient_RecordsTheRequestsRefusedAsUnavailable). Close marks the client closing first, so its own close is not a loss, and a request after it is refused as unavailable (naming errClosed) and a cast dropped. request and cast copy the fatal and closed state under c.mu and panic only after unlocking.

In process

InProcess(model) (inprocess.go) takes a model booted already (core.Model.Boot) and runs core.Start(model), NewServer, net.Pipe and a raising client, then Loop.Begin once the client has dialled (TestInProcess_BeginsTheLoop checks that the loop ticks). It returns the client and a stop function that closes the client, the server and the loop. No production code calls it; tests use it for the production stack in one process (app's TestRealLoop_…, this package's client tests). InProcessForTest (seams.go) is the same over a core.StartForTest loop, which holds its jobs and is returned for its seams, with a synchronous client; FlushForTest is the ping.

Tests

This package's tests run production (non-synchronous) clients; app's use the synchronous InProcessForTest client.

  • TestReplica_AnswersAsTheModel compares every local query through the client with the loop's raw answer (times as UTC instants, errors as text), so a field the codec drops shows.
  • TestWire_EveryFieldSurvives fills every field of every event and state view by reflection and round-trips it.
  • TestCoalesceKeys_MatchTheReplicasStateEvents keeps the server's coalescing keys in step with the events the replica keeps.
  • A scripted server end (scripted_test.go) sends frames a real Server never does: an unknown event, one that won't decode, a protocol reply.
  • Others cover events before replies, casts, coalescing, wakes, panics, a lost connection against Close, encode failures, the hello and the late joiner (Loop.SyncAndSnapshot has its own, in core/loop_test.go). route_test.go covers routing (colliding IDs, a request's Notice and Started naming it only to its client, every client's selection reaching the model), build_test.go covers CompareBuilds and Self, and server_backlog_test.go the notice backlog, Fatal and the hello deadline.
  • docs/specs/protocol.md is written from the method table and core.EventTypes() by go test ./core/rpc -run TestProtocolReference -update; TestProtocolReference fails when it is stale.

Documentation

Overview

Package rpc carries core.Core over a connection (daemon stage 2): newline-delimited JSON frames, a Server serving a core.Loop, and a Client implementing core.Core.

The client keeps a replica of the model's published state: it is sent the whole state when it connects (core.Model.Snapshot) and every change after (the state events Sync publishes), and answers every query from it, so only actions cross the wire. A request's reply follows the events the request produced, so a client that reads right after a request sees its effect. methods_gen.go, generated from core/iface.go, holds each method's wire types, the method table, the server's dispatch and the client's methods.

Index

Constants

View Source
const Protocol = 2

Protocol is the wire's version. Both sides send it in their hello and refuse a different one; the hello's build tells which side is newer. Adding a method or an optional field is compatible and needs no bump: a peer that lacks the method answers CodeUnsupported, an ordinary error, a peer ignores a field it does not know, and an event it does not know is dropped. Removing or renaming a method, event or field, or changing what a field means or a frame's shape, is incompatible and bumps it.

Variables

This section is empty.

Functions

func Build

func Build() string

Build names this binary: its module version, VCS revision and whether the tree was modified. A daemon records it in its lock.

func SetVersion

func SetVersion(v string)

SetVersion names this binary's release (main's version) for its hello. main calls it before any connection is made.

Types

type AccountEnvParams

type AccountEnvParams struct {
	Name string `json:"name"`
}

AccountEnvParams are AccountEnv's parameters on the wire.

type AccountEnvResult

type AccountEnvResult struct {
	Value []string `json:"value"`
}

AccountEnvResult is AccountEnv's result on the wire; an error travels in the reply.

type AccountLoggedOutParams

type AccountLoggedOutParams struct {
	Acct string `json:"acct"`
}

AccountLoggedOutParams are AccountLoggedOut's parameters on the wire.

type AccountLoggedOutResult

type AccountLoggedOutResult struct {
	Value bool `json:"value"`
}

AccountLoggedOutResult is AccountLoggedOut's result on the wire; an error travels in the reply.

type AccountNamesParams

type AccountNamesParams struct {
}

AccountNamesParams are AccountNames's parameters on the wire.

type AccountNamesResult

type AccountNamesResult struct {
	Value core.AccountNames `json:"value"`
}

AccountNamesResult is AccountNames's result on the wire; an error travels in the reply.

type AccountParams

type AccountParams struct {
	Name string `json:"name"`
}

AccountParams are Account's parameters on the wire.

type AccountResult

type AccountResult struct {
	Value account.Account `json:"value"`
	OK    bool            `json:"ok"`
}

AccountResult is Account's result on the wire; an error travels in the reply.

type AccountSyncParams

type AccountSyncParams struct {
	Name string `json:"name"`
}

AccountSyncParams are AccountSync's parameters on the wire.

type AccountSyncResult

type AccountSyncResult struct {
	Value account.SyncReport `json:"value"`
	OK    bool               `json:"ok"`
}

AccountSyncResult is AccountSync's result on the wire; an error travels in the reply.

type AccountUsageParams

type AccountUsageParams struct {
	Name string `json:"name"`
}

AccountUsageParams are AccountUsage's parameters on the wire.

type AccountUsageResult

type AccountUsageResult struct {
	Value account.Usage `json:"value"`
}

AccountUsageResult is AccountUsage's result on the wire; an error travels in the reply.

type AccountsLoadedParams

type AccountsLoadedParams struct {
}

AccountsLoadedParams are AccountsLoaded's parameters on the wire.

type AccountsLoadedResult

type AccountsLoadedResult struct {
	Value bool `json:"value"`
}

AccountsLoadedResult is AccountsLoaded's result on the wire; an error travels in the reply.

type AddAccountParams

type AddAccountParams struct {
	Name string `json:"name"`
}

AddAccountParams are AddAccount's parameters on the wire.

type AddAccountResult

type AddAccountResult struct {
	Value string `json:"value"`
}

AddAccountResult is AddAccount's result on the wire; an error travels in the reply.

type Backend

type Backend interface {
	core.Core
	SyncAndSnapshot() (published, snapshot []core.Event)
	SetSelection(ids []core.InstanceID)
	Wakes() <-chan struct{}
}

Backend is what a Server serves: the model's Core, a Sync and the whole state in one call for a client that connects (SyncAndSnapshot), every client's selected row at once (SetSelection), and its wakes (core.Loop has them all).

type ClaudeProgramParams

type ClaudeProgramParams struct {
}

ClaudeProgramParams are ClaudeProgram's parameters on the wire.

type ClaudeProgramResult

type ClaudeProgramResult struct {
	Value string `json:"value"`
}

ClaudeProgramResult is ClaudeProgram's result on the wire; an error travels in the reply.

type Client

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

Client is core.Core over a connection to a Server. It keeps a replica of the model's published state (sent whole when it connects, then every change), answers every rpc:local query from it, sends casts one way, and waits for each request's reply, which follows the events the request produced: a read right after a request sees its effect. Sync returns the events received since the last Sync, the state events coalesced to the newest state. Wakes signals when events arrive.

A server stopping gracefully says bye first (Stopping): from then on a request is refused at once, unavailable (core.ErrUnavailable), and a cast dropped, while the replies to requests in flight still arrive.

Losing the model (the connection lost, or the model failed: a panic, or a frame either side could not use) is fatal, and Wakes signals it. A daemon's client (Dial) then reports it (Err: unavailable when the server had said bye, so a stop is told from a crash) and panics nowhere: local reads answer from the last replica, requests are refused as unavailable and casts are dropped, so the TUI can quit or wait cleanly. An in-process client (InProcess) raises it instead: the caller that met it panics, and every call after it, so a model's own panic reaches its caller's recovery.

func Dial

func Dial(nc io.ReadWriteCloser) (*Client, error)

Dial says hello on nc, starts reading, and returns once the replica holds the server's snapshot: a daemon's client, which reports the model's loss rather than raising it (Err). A server of another protocol is a *MismatchError, carrying its hello when it sent one.

func InProcess

func InProcess(model *core.Model) (*Client, func(), error)

InProcess runs model, booted already (core.Model.Boot), as the daemon does (internal/daemon), inside this process: on its own loop (core.Start), served by a Server over one end of an in-memory pipe, with a Client on the other, which raises the model's loss (a panic reaches its caller). The loop starts its background work (core.Loop.Begin) once the client has connected, so nothing its first jobs publish (a Notice) goes to no one. It returns the client, which implements core.Core, and the function that stops all three. Tests use it for the production stack in one process.

func InProcessForTest

func InProcessForTest(model *core.Model) (*Client, *core.Loop, func(), error)

InProcessForTest is InProcess for a test of the client's user (the TUI): model runs on a loop that holds its jobs (core.StartForTest, returned for its seams) and has not begun (the test drives its jobs and tick by hand), and the client is synchronous, as the TUI's in-process calls were in stage 1E: it pings before every local read, so a read sees whatever the model published by then (a change the test made to the model directly included), and after every cast, so a cast has reached the model before the test reads it. Production code never calls it.

func (*Client) Account

func (c *Client) Account(name string) (account.Account, bool)

Account is core.Core's Account (local).

func (*Client) AccountEnv

func (c *Client) AccountEnv(name string) ([]string, error)

AccountEnv is core.Core's AccountEnv (local).

func (*Client) AccountLoggedOut

func (c *Client) AccountLoggedOut(acct string) bool

AccountLoggedOut is core.Core's AccountLoggedOut (local).

func (*Client) AccountNames

func (c *Client) AccountNames() core.AccountNames

AccountNames is core.Core's AccountNames (local).

func (*Client) AccountSync

func (c *Client) AccountSync(name string) (account.SyncReport, bool)

AccountSync is core.Core's AccountSync (local).

func (*Client) AccountUsage

func (c *Client) AccountUsage(name string) (account.Usage, error)

AccountUsage is core.Core's AccountUsage (local).

func (*Client) AccountsLoaded

func (c *Client) AccountsLoaded() bool

AccountsLoaded is core.Core's AccountsLoaded (local).

func (*Client) AddAccount

func (c *Client) AddAccount(name string) (string, error)

AddAccount is core.Core's AddAccount (request).

func (*Client) ClaudeProgram

func (c *Client) ClaudeProgram() string

ClaudeProgram is core.Core's ClaudeProgram (local).

func (*Client) Close

func (c *Client) Close()

Close ends the connection and waits for the reader, the only sender on Wakes, then closes Wakes.

func (*Client) Create

func (c *Client) Create(id core.WorkspaceID, spec core.NewInstance, req core.ReqID)

Create is core.Core's Create (request).

func (*Client) CredentialOverride

func (c *Client) CredentialOverride() string

CredentialOverride is core.Core's CredentialOverride (local).

func (*Client) Err

func (c *Client) Err() error

Err is the model's loss: the connection lost, or the model failed (a panic, or a frame either side could not use). A connection lost after the server said bye is the daemon stopping, and matches core.ErrUnavailable; one lost without is a crash, and does not. Nil while the model is reachable, while it is only stopping, and after Close.

func (*Client) ExpediteGitHub

func (c *Client) ExpediteGitHub()

ExpediteGitHub is core.Core's ExpediteGitHub (cast).

func (*Client) FetchIssue

func (c *Client) FetchIssue(repo string, number int, req core.ReqID)

FetchIssue is core.Core's FetchIssue (request).

func (*Client) FlushForTest

func (c *Client) FlushForTest() error

FlushForTest is the client's barrier (a ping): when it returns, everything the server published before answering is in the replica.

func (*Client) GitHubErr

func (c *Client) GitHubErr(repo string) error

GitHubErr is core.Core's GitHubErr (local).

func (*Client) GitHubSnapshot

func (c *Client) GitHubSnapshot(repo string) (github.Snapshot, bool)

GitHubSnapshot is core.Core's GitHubSnapshot (local).

func (*Client) GitHubUnavailable

func (c *Client) GitHubUnavailable() bool

GitHubUnavailable is core.Core's GitHubUnavailable (local).

func (*Client) GitHubUnavailableReason

func (c *Client) GitHubUnavailableReason() string

GitHubUnavailableReason is core.Core's GitHubUnavailableReason (local).

func (*Client) HasExtraAccounts

func (c *Client) HasExtraAccounts() bool

HasExtraAccounts is core.Core's HasExtraAccounts (local).

func (*Client) IsLoaded

func (c *Client) IsLoaded(id core.WorkspaceID) bool

IsLoaded is core.Core's IsLoaded (local).

func (*Client) Kill

func (c *Client) Kill(id core.InstanceID, req core.ReqID)

Kill is core.Core's Kill (request).

func (*Client) MarkOutput

func (c *Client) MarkOutput(sessionName string)

MarkOutput is core.Core's MarkOutput (cast).

func (*Client) Merge

func (c *Client) Merge(target core.InstanceID, source core.InstanceID, req core.ReqID)

Merge is core.Core's Merge (request).

func (*Client) Open

func (c *Client) Open(id core.WorkspaceID) (core.WorkspaceView, error)

Open is core.Core's Open (request).

func (*Client) PaneOutput

func (c *Client) PaneOutput(id core.InstanceID)

PaneOutput is core.Core's PaneOutput (cast).

func (*Client) PaneQuiet

func (c *Client) PaneQuiet(id core.InstanceID)

PaneQuiet is core.Core's PaneQuiet (cast).

func (*Client) Pause

func (c *Client) Pause(id core.InstanceID, req core.ReqID)

Pause is core.Core's Pause (request).

func (*Client) Peer

func (c *Client) Peer() Hello

Peer is the server's hello.

func (*Client) PersistOpenList

func (c *Client) PersistOpenList(names []string)

PersistOpenList is core.Core's PersistOpenList (request).

func (*Client) Push

func (c *Client) Push(id core.InstanceID, req core.ReqID)

Push is core.Core's Push (request).

func (*Client) RCAuth

func (c *Client) RCAuth() session.RemoteControlAuth

RCAuth is core.Core's RCAuth (local).

func (*Client) RCAuthFor

func (c *Client) RCAuthFor(acct string) session.RemoteControlAuth

RCAuthFor is core.Core's RCAuthFor (local).

func (*Client) Recover

func (c *Client) Recover(id core.InstanceID, req core.ReqID)

Recover is core.Core's Recover (request).

func (*Client) Register

func (c *Client) Register(name string, dir string) (core.WorkspaceView, error)

Register is core.Core's Register (request).

func (*Client) Registry

func (c *Client) Registry() core.RegistryView

Registry is core.Core's Registry (local).

func (*Client) ReloadAccounts

func (c *Client) ReloadAccounts()

ReloadAccounts is core.Core's ReloadAccounts (request).

func (*Client) ReloadRegistry

func (c *Client) ReloadRegistry() error

ReloadRegistry is core.Core's ReloadRegistry (request).

func (*Client) RemoveAccount

func (c *Client) RemoveAccount(name string, force bool) error

RemoveAccount is core.Core's RemoveAccount (request).

func (*Client) RenameWorkspace

func (c *Client) RenameWorkspace(from string, to string) error

RenameWorkspace is core.Core's RenameWorkspace (request).

func (*Client) RequestAccountsRefresh

func (c *Client) RequestAccountsRefresh(withDefault bool)

RequestAccountsRefresh is core.Core's RequestAccountsRefresh (cast).

func (*Client) RequestUsageProbe

func (c *Client) RequestUsageProbe()

RequestUsageProbe is core.Core's RequestUsageProbe (cast).

func (*Client) Reset

func (c *Client) Reset(id core.WorkspaceID, req core.ReqID) error

Reset is core.Core's Reset (request).

func (*Client) Resume

func (c *Client) Resume(id core.InstanceID, req core.ReqID)

Resume is core.Core's Resume (request).

func (*Client) ResumeWith

func (c *Client) ResumeWith(id core.InstanceID, opts launch.Options, base string, req core.ReqID)

ResumeWith is core.Core's ResumeWith (request).

func (*Client) RunningAsAccount

func (c *Client) RunningAsAccount() string

RunningAsAccount is core.Core's RunningAsAccount (local).

func (*Client) SaveForQuit

func (c *Client) SaveForQuit() error

SaveForQuit is core.Core's SaveForQuit (request).

func (*Client) SaveSettings

func (c *Client) SaveSettings(id core.WorkspaceID, settings config.Settings) error

SaveSettings is core.Core's SaveSettings (request).

func (*Client) SendPrompt

func (c *Client) SendPrompt(id core.InstanceID, text string, req core.ReqID)

SendPrompt is core.Core's SendPrompt (request).

func (*Client) SetDefaultAccount

func (c *Client) SetDefaultAccount(name string) error

SetDefaultAccount is core.Core's SetDefaultAccount (request).

func (*Client) SetHelpScreensSeen

func (c *Client) SetHelpScreensSeen(id core.WorkspaceID, seen uint32) error

SetHelpScreensSeen is core.Core's SetHelpScreensSeen (request).

func (*Client) SetLastUsed

func (c *Client) SetLastUsed(name string) error

SetLastUsed is core.Core's SetLastUsed (request).

func (*Client) SetSelected

func (c *Client) SetSelected(id core.InstanceID)

SetSelected is core.Core's SetSelected (cast).

func (*Client) SetUIPrefs

func (c *Client) SetUIPrefs(id core.WorkspaceID, prefs config.UIPrefs) error

SetUIPrefs is core.Core's SetUIPrefs (request).

func (*Client) Stopping

func (c *Client) Stopping() bool

Stopping reports whether the server has said bye: it is stopping, takes no request, and will close the connection once the replies to requests in flight are sent.

func (*Client) Sync

func (c *Client) Sync() []core.Event

Sync returns the events received since the last Sync (rpc:client): first the state events, coalesced to the newest state, in the model's order, then the others in the order they arrived.

func (*Client) TakeRefused

func (c *Client) TakeRefused() []core.ReqID

TakeRefused returns, and forgets, the request IDs of the calls refused as unavailable since the last TakeRefused (noteRefused): requests no Reply will answer, whichever side of a bye they were made on. A request whose connection went before its reply counts too, though its Reply may have arrived first: a caller fails only the requests still waiting.

func (*Client) Unregister

func (c *Client) Unregister(name string) error

Unregister is core.Core's Unregister (request).

func (*Client) VerifyDead

func (c *Client) VerifyDead(id core.InstanceID)

VerifyDead is core.Core's VerifyDead (cast).

func (*Client) View

func (c *Client) View(id core.InstanceID) (core.InstanceView, bool)

View is core.Core's View (local).

func (*Client) Views

func (c *Client) Views(id core.WorkspaceID) []core.InstanceView

Views is core.Core's Views (local).

func (*Client) Wakes

func (c *Client) Wakes() <-chan struct{}

Wakes signals that events arrived for Sync. Wakes coalesce; Close closes it.

func (*Client) WatchGitHub

func (c *Client) WatchGitHub(repo string)

WatchGitHub is core.Core's WatchGitHub (cast).

func (*Client) Workspace

func (c *Client) Workspace(id core.WorkspaceID) (core.WorkspaceView, bool)

Workspace is core.Core's Workspace (local).

func (*Client) Workspaces

func (c *Client) Workspaces() []core.WorkspaceView

Workspaces is core.Core's Workspaces (local).

type CreateParams

type CreateParams struct {
	ID   core.WorkspaceID `json:"id"`
	Spec core.NewInstance `json:"spec"`
	Req  core.ReqID       `json:"req"`
}

CreateParams are Create's parameters on the wire.

type CreateResult

type CreateResult struct {
}

CreateResult is Create's result on the wire; an error travels in the reply.

type CredentialOverrideParams

type CredentialOverrideParams struct {
}

CredentialOverrideParams are CredentialOverride's parameters on the wire.

type CredentialOverrideResult

type CredentialOverrideResult struct {
	Value string `json:"value"`
}

CredentialOverrideResult is CredentialOverride's result on the wire; an error travels in the reply.

type ExpediteGitHubParams

type ExpediteGitHubParams struct {
}

ExpediteGitHubParams are ExpediteGitHub's parameters on the wire.

type ExpediteGitHubResult

type ExpediteGitHubResult struct {
}

ExpediteGitHubResult is ExpediteGitHub's result on the wire; an error travels in the reply.

type FetchIssueParams

type FetchIssueParams struct {
	Repo   string     `json:"repo"`
	Number int        `json:"number"`
	Req    core.ReqID `json:"req"`
}

FetchIssueParams are FetchIssue's parameters on the wire.

type FetchIssueResult

type FetchIssueResult struct {
}

FetchIssueResult is FetchIssue's result on the wire; an error travels in the reply.

type Frame

type Frame struct {
	Hello  *Hello          `json:"hello,omitempty"`
	ID     uint64          `json:"id,omitempty"`
	Method string          `json:"method,omitempty"`
	Params json.RawMessage `json:"params,omitempty"`
	Result json.RawMessage `json:"result,omitempty"`
	Error  *core.WireError `json:"error,omitempty"`
	Event  string          `json:"event,omitempty"`
	Data   json.RawMessage `json:"data,omitempty"`
	Fatal  *core.WireError `json:"fatal,omitempty"`
	Bye    string          `json:"bye,omitempty"`
}

Frame is one line on the wire. Exactly one of its shapes is set:

  • a hello: Hello;
  • a request: Method, Params and a non-zero ID (a cast has no ID);
  • a reply: ID, Result and Error;
  • an event: Event (its Go type name) and Data;
  • a fatal error: Fatal, which every later call re-raises;
  • a bye: Bye, the reason a server is going ("stopping"). It takes no request after it, replies to the requests in flight still follow, then the connection closes. Optional: a peer that does not know it decodes past the field, and the frame matches nothing it reads.

type GitHubErrParams

type GitHubErrParams struct {
	Repo string `json:"repo"`
}

GitHubErrParams are GitHubErr's parameters on the wire.

type GitHubErrResult

type GitHubErrResult struct {
}

GitHubErrResult is GitHubErr's result on the wire; an error travels in the reply.

type GitHubSnapshotParams

type GitHubSnapshotParams struct {
	Repo string `json:"repo"`
}

GitHubSnapshotParams are GitHubSnapshot's parameters on the wire.

type GitHubSnapshotResult

type GitHubSnapshotResult struct {
	Value github.Snapshot `json:"value"`
	OK    bool            `json:"ok"`
}

GitHubSnapshotResult is GitHubSnapshot's result on the wire; an error travels in the reply.

type GitHubUnavailableParams

type GitHubUnavailableParams struct {
}

GitHubUnavailableParams are GitHubUnavailable's parameters on the wire.

type GitHubUnavailableReasonParams

type GitHubUnavailableReasonParams struct {
}

GitHubUnavailableReasonParams are GitHubUnavailableReason's parameters on the wire.

type GitHubUnavailableReasonResult

type GitHubUnavailableReasonResult struct {
	Value string `json:"value"`
}

GitHubUnavailableReasonResult is GitHubUnavailableReason's result on the wire; an error travels in the reply.

type GitHubUnavailableResult

type GitHubUnavailableResult struct {
	Value bool `json:"value"`
}

GitHubUnavailableResult is GitHubUnavailable's result on the wire; an error travels in the reply.

type HasExtraAccountsParams

type HasExtraAccountsParams struct {
}

HasExtraAccountsParams are HasExtraAccounts's parameters on the wire.

type HasExtraAccountsResult

type HasExtraAccountsResult struct {
	Value bool `json:"value"`
}

HasExtraAccountsResult is HasExtraAccounts's result on the wire; an error travels in the reply.

type Hello

type Hello struct {
	Protocol int    `json:"protocol"`
	Build    string `json:"build"`
	// Version is the release (main's version, SetVersion).
	Version string `json:"version,omitempty"`
	// Time is when the VCS revision was committed (RFC 3339): vcs.time,
	// else the commit time the build stamped (commitUnix, as Nix does).
	Time string `json:"time,omitempty"`
	// Modified says the tree was modified when built (vcs.modified).
	Modified bool `json:"modified,omitempty"`
	// Exe is the SHA-256 of the running executable, in hex: two builds of
	// one commit with different edits agree on everything else.
	Exe string `json:"exe,omitempty"`
	// ExeTime is when the running executable was last modified (UTC, RFC
	// 3339), which breaks a tie nothing else decides when both sides name
	// their commit (Time): a rebuild at one commit is newer. One at or
	// before the epoch's first second (a Nix store's) tells nothing.
	ExeTime string `json:"exe_time,omitempty"`
	// Tmux is the tmux server the server's sessions run on (its socket's
	// path), which its clients use too (Server.SetTmux). Servers only.
	Tmux string `json:"tmux,omitempty"`
}

Hello is each side's first frame: its protocol and its build, which a client compares with the server's (CompareBuilds: the newer side wins). A server sends its own even to a peer of another protocol, ahead of the mismatch error, so every client learns the server's build. The fields after Build are optional: a peer that lacks them leaves them empty.

func Self

func Self() Hello

Self is this binary's hello: its protocol and build. A server adds the tmux server it serves (Server.SetTmux).

type IsLoadedParams

type IsLoadedParams struct {
	ID core.WorkspaceID `json:"id"`
}

IsLoadedParams are IsLoaded's parameters on the wire.

type IsLoadedResult

type IsLoadedResult struct {
	Value bool `json:"value"`
}

IsLoadedResult is IsLoaded's result on the wire; an error travels in the reply.

type KillParams

type KillParams struct {
	ID  core.InstanceID `json:"id"`
	Req core.ReqID      `json:"req"`
}

KillParams are Kill's parameters on the wire.

type KillResult

type KillResult struct {
}

KillResult is Kill's result on the wire; an error travels in the reply.

type MarkOutputParams

type MarkOutputParams struct {
	SessionName string `json:"sessionName"`
}

MarkOutputParams are MarkOutput's parameters on the wire.

type MarkOutputResult

type MarkOutputResult struct {
}

MarkOutputResult is MarkOutput's result on the wire; an error travels in the reply.

type MergeParams

type MergeParams struct {
	Target core.InstanceID `json:"target"`
	Source core.InstanceID `json:"source"`
	Req    core.ReqID      `json:"req"`
}

MergeParams are Merge's parameters on the wire.

type MergeResult

type MergeResult struct {
}

MergeResult is Merge's result on the wire; an error travels in the reply.

type MismatchError

type MismatchError struct {
	Peer *Hello
}

MismatchError is Dial's error when the server speaks another protocol. Peer is the server's hello, nil when it sent none (a server from before servers said hello first), so a client can still tell which build is newer and replace an older server.

func (*MismatchError) Error

func (e *MismatchError) Error() string

type OpenParams

type OpenParams struct {
	ID core.WorkspaceID `json:"id"`
}

OpenParams are Open's parameters on the wire.

type OpenResult

type OpenResult struct {
	Value core.WorkspaceView `json:"value"`
}

OpenResult is Open's result on the wire; an error travels in the reply.

type Order

type Order int

Order is how a client's build compares with a server's (CompareBuilds).

const (
	// SameBuild is one build on both sides: one executable, or two that
	// nothing tells apart.
	SameBuild Order = iota
	// ClientNewer is a client newer than its server: it replaces the server.
	ClientNewer
	// ServerNewer is a server newer than its client: the client must be
	// upgraded.
	ServerNewer
)

func CompareBuilds

func CompareBuilds(client, server Hello) Order

CompareBuilds says which of a client's and a server's builds is newer, from their hellos: the same executable (Exe) is the same build; otherwise the higher release (Version, as semver), then the later commit (Time), then a modified tree over a clean one, then the higher protocol (a peer that sent no hello, protocol 0, is older than any that did), then, only when both name their commit (Time), the newer executable (ExeTime: both were built from a checkout at one commit, and a dev build edited or rebuilt there replaces its sandbox's server). A field either side lacks, or can't be read, decides nothing, and a full tie is otherwise the same build: two installs of one release keep whichever daemon runs rather than replace each other's on every launch, and a loom whose executable can't be read keeps the daemon rather than stop it on every launch. An executable dated at or before the epoch's first second tells nothing either (knownExeTime): a Nix store dates every file there, so a Nix build and a release binary of one commit keep whichever daemon runs rather than refuse each other as newer, and two Nix builds are told apart by the commit time the flake stamps (commitUnix). A build that names no commit (a plain go build from a tarball) at the same release keeps the running daemon: `loom serve stop` switches.

type PaneOutputParams

type PaneOutputParams struct {
	ID core.InstanceID `json:"id"`
}

PaneOutputParams are PaneOutput's parameters on the wire.

type PaneOutputResult

type PaneOutputResult struct {
}

PaneOutputResult is PaneOutput's result on the wire; an error travels in the reply.

type PaneQuietParams

type PaneQuietParams struct {
	ID core.InstanceID `json:"id"`
}

PaneQuietParams are PaneQuiet's parameters on the wire.

type PaneQuietResult

type PaneQuietResult struct {
}

PaneQuietResult is PaneQuiet's result on the wire; an error travels in the reply.

type PauseParams

type PauseParams struct {
	ID  core.InstanceID `json:"id"`
	Req core.ReqID      `json:"req"`
}

PauseParams are Pause's parameters on the wire.

type PauseResult

type PauseResult struct {
}

PauseResult is Pause's result on the wire; an error travels in the reply.

type PersistOpenListParams

type PersistOpenListParams struct {
	Names []string `json:"names"`
}

PersistOpenListParams are PersistOpenList's parameters on the wire.

type PersistOpenListResult

type PersistOpenListResult struct {
}

PersistOpenListResult is PersistOpenList's result on the wire; an error travels in the reply.

type PushParams

type PushParams struct {
	ID  core.InstanceID `json:"id"`
	Req core.ReqID      `json:"req"`
}

PushParams are Push's parameters on the wire.

type PushResult

type PushResult struct {
}

PushResult is Push's result on the wire; an error travels in the reply.

type RCAuthForParams

type RCAuthForParams struct {
	Acct string `json:"acct"`
}

RCAuthForParams are RCAuthFor's parameters on the wire.

type RCAuthForResult

type RCAuthForResult struct {
	Value session.RemoteControlAuth `json:"value"`
}

RCAuthForResult is RCAuthFor's result on the wire; an error travels in the reply.

type RCAuthParams

type RCAuthParams struct {
}

RCAuthParams are RCAuth's parameters on the wire.

type RCAuthResult

type RCAuthResult struct {
	Value session.RemoteControlAuth `json:"value"`
}

RCAuthResult is RCAuth's result on the wire; an error travels in the reply.

type RecoverParams

type RecoverParams struct {
	ID  core.InstanceID `json:"id"`
	Req core.ReqID      `json:"req"`
}

RecoverParams are Recover's parameters on the wire.

type RecoverResult

type RecoverResult struct {
}

RecoverResult is Recover's result on the wire; an error travels in the reply.

type RegisterParams

type RegisterParams struct {
	Name string `json:"name"`
	Dir  string `json:"dir"`
}

RegisterParams are Register's parameters on the wire.

type RegisterResult

type RegisterResult struct {
	Value core.WorkspaceView `json:"value"`
}

RegisterResult is Register's result on the wire; an error travels in the reply.

type RegistryParams

type RegistryParams struct {
}

RegistryParams are Registry's parameters on the wire.

type RegistryResult

type RegistryResult struct {
	Value core.RegistryView `json:"value"`
}

RegistryResult is Registry's result on the wire; an error travels in the reply.

type ReloadAccountsParams

type ReloadAccountsParams struct {
}

ReloadAccountsParams are ReloadAccounts's parameters on the wire.

type ReloadAccountsResult

type ReloadAccountsResult struct {
}

ReloadAccountsResult is ReloadAccounts's result on the wire; an error travels in the reply.

type ReloadRegistryParams

type ReloadRegistryParams struct {
}

ReloadRegistryParams are ReloadRegistry's parameters on the wire.

type ReloadRegistryResult

type ReloadRegistryResult struct {
}

ReloadRegistryResult is ReloadRegistry's result on the wire; an error travels in the reply.

type RemoveAccountParams

type RemoveAccountParams struct {
	Name  string `json:"name"`
	Force bool   `json:"force"`
}

RemoveAccountParams are RemoveAccount's parameters on the wire.

type RemoveAccountResult

type RemoveAccountResult struct {
}

RemoveAccountResult is RemoveAccount's result on the wire; an error travels in the reply.

type RenameWorkspaceParams

type RenameWorkspaceParams struct {
	From string `json:"from"`
	To   string `json:"to"`
}

RenameWorkspaceParams are RenameWorkspace's parameters on the wire.

type RenameWorkspaceResult

type RenameWorkspaceResult struct {
}

RenameWorkspaceResult is RenameWorkspace's result on the wire; an error travels in the reply.

type RequestAccountsRefreshParams

type RequestAccountsRefreshParams struct {
	WithDefault bool `json:"withDefault"`
}

RequestAccountsRefreshParams are RequestAccountsRefresh's parameters on the wire.

type RequestAccountsRefreshResult

type RequestAccountsRefreshResult struct {
}

RequestAccountsRefreshResult is RequestAccountsRefresh's result on the wire; an error travels in the reply.

type RequestUsageProbeParams

type RequestUsageProbeParams struct {
}

RequestUsageProbeParams are RequestUsageProbe's parameters on the wire.

type RequestUsageProbeResult

type RequestUsageProbeResult struct {
}

RequestUsageProbeResult is RequestUsageProbe's result on the wire; an error travels in the reply.

type ResetParams

type ResetParams struct {
	ID  core.WorkspaceID `json:"id"`
	Req core.ReqID       `json:"req"`
}

ResetParams are Reset's parameters on the wire.

type ResetResult

type ResetResult struct {
}

ResetResult is Reset's result on the wire; an error travels in the reply.

type ResumeParams

type ResumeParams struct {
	ID  core.InstanceID `json:"id"`
	Req core.ReqID      `json:"req"`
}

ResumeParams are Resume's parameters on the wire.

type ResumeResult

type ResumeResult struct {
}

ResumeResult is Resume's result on the wire; an error travels in the reply.

type ResumeWithParams

type ResumeWithParams struct {
	ID   core.InstanceID `json:"id"`
	Opts launch.Options  `json:"opts"`
	Base string          `json:"base"`
	Req  core.ReqID      `json:"req"`
}

ResumeWithParams are ResumeWith's parameters on the wire.

type ResumeWithResult

type ResumeWithResult struct {
}

ResumeWithResult is ResumeWith's result on the wire; an error travels in the reply.

type RunningAsAccountParams

type RunningAsAccountParams struct {
}

RunningAsAccountParams are RunningAsAccount's parameters on the wire.

type RunningAsAccountResult

type RunningAsAccountResult struct {
	Value string `json:"value"`
}

RunningAsAccountResult is RunningAsAccount's result on the wire; an error travels in the reply.

type SaveForQuitParams

type SaveForQuitParams struct {
}

SaveForQuitParams are SaveForQuit's parameters on the wire.

type SaveForQuitResult

type SaveForQuitResult struct {
}

SaveForQuitResult is SaveForQuit's result on the wire; an error travels in the reply.

type SaveSettingsParams

type SaveSettingsParams struct {
	ID       core.WorkspaceID `json:"id"`
	Settings config.Settings  `json:"settings"`
}

SaveSettingsParams are SaveSettings's parameters on the wire.

type SaveSettingsResult

type SaveSettingsResult struct {
}

SaveSettingsResult is SaveSettings's result on the wire; an error travels in the reply.

type SendPromptParams

type SendPromptParams struct {
	ID   core.InstanceID `json:"id"`
	Text string          `json:"text"`
	Req  core.ReqID      `json:"req"`
}

SendPromptParams are SendPrompt's parameters on the wire.

type SendPromptResult

type SendPromptResult struct {
}

SendPromptResult is SendPrompt's result on the wire; an error travels in the reply.

type Server

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

Server serves a Backend to any number of connections. After every call and every wake it publishes (Backend.Sync) to every connection, but an event naming a request as forConn routes it: a Reply, or a request's Notice, only to the connection that made the request, and Started or Recovered to every connection, naming the request to that one alone. A request's reply follows the events its call produced. A connection is sent the whole state (Backend.SyncAndSnapshot) when it connects.

func NewServer

func NewServer(b Backend) *Server

NewServer serves b; it starts publishing on b's wakes.

func (*Server) Bye

func (s *Server) Bye()

Bye starts a graceful stop: every connection is sent a bye, and from then on the server takes nothing new. A request is answered unavailable without reaching the backend, a cast is dropped, and a connection that joins is sent the bye after its snapshot. Replies to the requests in flight still follow, as their jobs land; Close ends the connections. It returns once the calls already let through have had their replies queued, so a Close after it flushes them, and whatever jobs they started are in flight when the caller waits for them (core.Loop.Quiesce).

func (*Server) Close

func (s *Server) Close()

Close ends every connection and stops publishing. Unless the model has failed, it publishes once more first, so whatever the backend produced before Close (the Reply of a request in flight at the bye, say) reaches its client even if no wake has published it yet. Then every connection's writer flushes what is queued, a fatal frame included (in parallel, each for up to closeFlushTimeout), and every connection is closed, one that has not said hello included.

func (*Server) Fatal

func (s *Server) Fatal() <-chan struct{}

Fatal is closed once the model is as good as gone (it panicked, or an event would not encode): whatever runs the server should stop. FatalError says why.

func (*Server) FatalError

func (s *Server) FatalError() error

FatalError is the error that made the server fatal, nil while it is not.

func (*Server) Keep

func (s *Server) Keep(notices ...core.Notice)

Keep holds notices for the next connection, as if raised while none was connected: a daemon's boot raises them before any client can be (core.Model.Boot).

func (*Server) Serve

func (s *Server) Serve(nc io.ReadWriteCloser)

Serve serves nc on a goroutine of its own until it closes (serveConn). After Close it closes nc at once and serves nothing.

func (*Server) SetTmux

func (s *Server) SetTmux(path string)

SetTmux names, in the hello every later connection is sent, the tmux server the model's sessions run on (its socket's path): the daemon's, which its clients must use too, whatever their own environment says.

type SetDefaultAccountParams

type SetDefaultAccountParams struct {
	Name string `json:"name"`
}

SetDefaultAccountParams are SetDefaultAccount's parameters on the wire.

type SetDefaultAccountResult

type SetDefaultAccountResult struct {
}

SetDefaultAccountResult is SetDefaultAccount's result on the wire; an error travels in the reply.

type SetHelpScreensSeenParams

type SetHelpScreensSeenParams struct {
	ID   core.WorkspaceID `json:"id"`
	Seen uint32           `json:"seen"`
}

SetHelpScreensSeenParams are SetHelpScreensSeen's parameters on the wire.

type SetHelpScreensSeenResult

type SetHelpScreensSeenResult struct {
}

SetHelpScreensSeenResult is SetHelpScreensSeen's result on the wire; an error travels in the reply.

type SetLastUsedParams

type SetLastUsedParams struct {
	Name string `json:"name"`
}

SetLastUsedParams are SetLastUsed's parameters on the wire.

type SetLastUsedResult

type SetLastUsedResult struct {
}

SetLastUsedResult is SetLastUsed's result on the wire; an error travels in the reply.

type SetSelectedParams

type SetSelectedParams struct {
	ID core.InstanceID `json:"id"`
}

SetSelectedParams are SetSelected's parameters on the wire.

type SetSelectedResult

type SetSelectedResult struct {
}

SetSelectedResult is SetSelected's result on the wire; an error travels in the reply.

type SetUIPrefsParams

type SetUIPrefsParams struct {
	ID    core.WorkspaceID `json:"id"`
	Prefs config.UIPrefs   `json:"prefs"`
}

SetUIPrefsParams are SetUIPrefs's parameters on the wire.

type SetUIPrefsResult

type SetUIPrefsResult struct {
}

SetUIPrefsResult is SetUIPrefs's result on the wire; an error travels in the reply.

type UnregisterParams

type UnregisterParams struct {
	Name string `json:"name"`
}

UnregisterParams are Unregister's parameters on the wire.

type UnregisterResult

type UnregisterResult struct {
}

UnregisterResult is Unregister's result on the wire; an error travels in the reply.

type VerifyDeadParams

type VerifyDeadParams struct {
	ID core.InstanceID `json:"id"`
}

VerifyDeadParams are VerifyDead's parameters on the wire.

type VerifyDeadResult

type VerifyDeadResult struct {
}

VerifyDeadResult is VerifyDead's result on the wire; an error travels in the reply.

type ViewParams

type ViewParams struct {
	ID core.InstanceID `json:"id"`
}

ViewParams are View's parameters on the wire.

type ViewResult

type ViewResult struct {
	Value core.InstanceView `json:"value"`
	OK    bool              `json:"ok"`
}

ViewResult is View's result on the wire; an error travels in the reply.

type ViewsParams

type ViewsParams struct {
	ID core.WorkspaceID `json:"id"`
}

ViewsParams are Views's parameters on the wire.

type ViewsResult

type ViewsResult struct {
	Value []core.InstanceView `json:"value"`
}

ViewsResult is Views's result on the wire; an error travels in the reply.

type WatchGitHubParams

type WatchGitHubParams struct {
	Repo string `json:"repo"`
}

WatchGitHubParams are WatchGitHub's parameters on the wire.

type WatchGitHubResult

type WatchGitHubResult struct {
}

WatchGitHubResult is WatchGitHub's result on the wire; an error travels in the reply.

type WorkspaceParams

type WorkspaceParams struct {
	ID core.WorkspaceID `json:"id"`
}

WorkspaceParams are Workspace's parameters on the wire.

type WorkspaceResult

type WorkspaceResult struct {
	Value core.WorkspaceView `json:"value"`
	OK    bool               `json:"ok"`
}

WorkspaceResult is Workspace's result on the wire; an error travels in the reply.

type WorkspacesParams

type WorkspacesParams struct {
}

WorkspacesParams are Workspaces's parameters on the wire.

type WorkspacesResult

type WorkspacesResult struct {
	Value []core.WorkspaceView `json:"value"`
}

WorkspacesResult is Workspaces's result on the wire; an error travels in the reply.

Directories

Path Synopsis
internal
gen
Package gen generates core/rpc's wire code from core.Core (core/iface.go): every method's parameter and result types, the method table, the server's dispatch, and the client's methods.
Package gen generates core/rpc's wire code from core.Core (core/iface.go): every method's parameter and result types, the method table, the server's dispatch, and the client's methods.
gen/cmd command
Command cmd writes core/rpc/methods_gen.go from core/iface.go.
Command cmd writes core/rpc/methods_gen.go from core/iface.go.

Jump to

Keyboard shortcuts

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