State for remote agent sessions and remote file buffers.
Summary
Types
Remote session metadata is normally MingaAgent.SessionMetadata.t(). The map fallback keeps compatibility with older remote nodes that may return decoded persisted metadata before both nodes share the exact struct module version.
Functions
Returns all tracked remote buffers with their server names and paths.
Finds an open buffer for a remote file.
Returns all tracked remote buffers for path, across servers.
Tracks the buffer pid used to display a remote file.
Marks a server's connection status.
Stores the latest discovered remote sessions for a server.
Returns a server's known connection status.
Returns all discovered remote sessions grouped by server name.
Types
@type remote_connection_status() :: :connected | :disconnected | :ended | :unavailable
@type remote_session_entry() :: {String.t(), pid(), session_metadata()}
@type session_metadata() :: MingaAgent.SessionMetadata.t() | map()
Remote session metadata is normally MingaAgent.SessionMetadata.t(). The map fallback keeps compatibility with older remote nodes that may return decoded persisted metadata before both nodes share the exact struct module version.
@type t() :: %MingaEditor.State.Remote{ buffers: %{required(remote_file_key()) => pid()}, server_status: %{required(String.t()) => remote_connection_status()}, sessions: %{required(String.t()) => [remote_session_entry()]} }
Functions
Returns all tracked remote buffers with their server names and paths.
Finds an open buffer for a remote file.
Returns all tracked remote buffers for path, across servers.
Tracks the buffer pid used to display a remote file.
@spec put_server_status(t(), String.t(), remote_connection_status()) :: t()
Marks a server's connection status.
@spec put_sessions(t(), String.t(), [remote_session_entry()]) :: t()
Stores the latest discovered remote sessions for a server.
@spec server_status(t(), String.t()) :: remote_connection_status()
Returns a server's known connection status.
@spec sessions(t()) :: %{required(String.t()) => [remote_session_entry()]}
Returns all discovered remote sessions grouped by server name.