Termite.SSH.Session (termite_ssh v0.1.0)

Copy Markdown View Source

Per-connection context passed to a Termite.SSH session entrypoint.

Sessions are created by Termite.SSH; applications should treat the struct as read-only. Use Termite.SSH.terminal/1 to attach a terminal and Termite.SSH.disconnect/1 to close the SSH channel.

Summary

Types

t()

An SSH-backed Termite session.

Functions

Invokes the session's disconnect callback.

Adds this session's SSH adapter settings to Termite terminal options.

Types

t()

@type t() :: %Termite.SSH.Session{
  channel_pid: pid(),
  disconnect: (-> term()),
  id: reference(),
  username: String.t()
}

An SSH-backed Termite session.

Functions

disconnect(session)

@spec disconnect(t()) :: term()

Invokes the session's disconnect callback.

Prefer the public Termite.SSH.disconnect/1 wrapper in application code.

terminal_opts(session, opts \\ [])

@spec terminal_opts(t(), keyword()) :: keyword()

Adds this session's SSH adapter settings to Termite terminal options.

The SSH adapter and channel override values supplied in opts. Most callers should use Termite.SSH.terminal/1; this function is useful when additional adapter options, such as :reader_target, are needed.