1) SftpEx.get_type doesn't return {:ok, type} when it succeed, as stated in the documentation, but only type.
2) You should add the Access behaviour to Sftp.Connection :
@behaviour Access
and
# Access callbacks the easy way
def fetch(term, key) do
term
|> Map.from_struct()
|> Map.fetch(key)
end
def get(term, key, default) do
term
|> Map.from_struct()
|> Map.get(key, default)
end
def get_and_update(data, key, function) do
data
|> Map.from_struct()
|> Map.get_and_update(key, function)
end
def pop(data, key) do
data
|> Map.from_struct()
|> Map.pop(key)
end
Hi Mike,
First: Congrats for the good SFTP Elixir job !
1) SftpEx.get_type doesn't return {:ok, type} when it succeed, as stated in the documentation, but only type.
2) You should add the Access behaviour to Sftp.Connection :
@behaviour Access
and
to avoid access errors...
Best regards.