Skip to content

Commit e54d1ec

Browse files
pmeinhardtandreasknoepfle
authored andcommitted
Re-order functions in Channel module
1 parent a14269f commit e54d1ec

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

lib/sshkit/channel.ex

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,6 @@ defmodule SSHKit.Channel do
4747
%__MODULE__{connection: conn, type: :session, id: id}
4848
end
4949

50-
@doc """
51-
Activates a subsystem on a channel.
52-
53-
Returns `:success`, `:failure` or `{:error, reason}`.
54-
55-
For more details, see [`:ssh_connection.subsystem/4`](http://erlang.org/doc/man/ssh_connection.html#subsystem-4).
56-
"""
57-
@spec subsystem(t(), binary(), keyword()) :: :success | :failure | {:error, term()}
58-
def subsystem(channel, subsystem, options \\ []) do
59-
timeout = Keyword.get(options, :timeout, :infinity)
60-
@core.subsystem(channel.connection.ref, channel.id, to_charlist(subsystem), timeout)
61-
end
62-
6350
@doc """
6451
Closes an SSH channel.
6552
@@ -95,6 +82,19 @@ defmodule SSHKit.Channel do
9582
@core.exec(channel.connection.ref, channel.id, command, timeout)
9683
end
9784

85+
@doc """
86+
Activates a subsystem on a channel.
87+
88+
Returns `:success`, `:failure` or `{:error, reason}`.
89+
90+
For more details, see [`:ssh_connection.subsystem/4`](http://erlang.org/doc/man/ssh_connection.html#subsystem-4).
91+
"""
92+
@spec subsystem(t(), binary(), keyword()) :: :success | :failure | {:error, term()}
93+
def subsystem(channel, subsystem, options \\ []) do
94+
timeout = Keyword.get(options, :timeout, :infinity)
95+
@core.subsystem(channel.connection.ref, channel.id, to_charlist(subsystem), timeout)
96+
end
97+
9898
@doc """
9999
Allocates PTTY.
100100
@@ -177,6 +177,18 @@ defmodule SSHKit.Channel do
177177
end
178178
end
179179

180+
@doc """
181+
Adjusts the flow control window.
182+
183+
Returns `:ok`.
184+
185+
For more details, see [`:ssh_connection.adjust_window/3`](http://erlang.org/doc/man/ssh_connection.html#adjust_window-3).
186+
"""
187+
@spec adjust(t(), non_neg_integer()) :: :ok
188+
def adjust(channel, size) when is_integer(size) do
189+
@core.adjust_window(channel.connection.ref, channel.id, size)
190+
end
191+
180192
@doc """
181193
Flushes any pending messages for the given channel.
182194
@@ -193,16 +205,4 @@ defmodule SSHKit.Channel do
193205
timeout -> :ok
194206
end
195207
end
196-
197-
@doc """
198-
Adjusts the flow control window.
199-
200-
Returns `:ok`.
201-
202-
For more details, see [`:ssh_connection.adjust_window/3`](http://erlang.org/doc/man/ssh_connection.html#adjust_window-3).
203-
"""
204-
@spec adjust(t(), non_neg_integer()) :: :ok
205-
def adjust(channel, size) when is_integer(size) do
206-
@core.adjust_window(channel.connection.ref, channel.id, size)
207-
end
208208
end

0 commit comments

Comments
 (0)