Belt v0.5.1 Belt.Provider.SFTP View Source

Link to this section Summary

Types

Public key or public key fingerprint

Options for creating an SFTP provider

Private key or private key PEM string

Functions

Creates a new SFTP provider configuration with default credentials

Implementation of the Provider.delete/3 callback

Implementation of the Provider.delete_all/2 callback

Implementation of the Provider.delete_scope/3 callback

Implementation of the Provider.get_info/3 callback

Implementation of the Belt.Provider.get_url/3 callback

Implementation of the Belt.Provider.list_files/2 callback

Creates a new SFTP provider configuration

Implementation of the Provider.store/3 callback

Implementation of the Provider.store_data/3 callback

Implementation of the Provider.test_connection/2 callback

Link to this section Types

Public key or public key fingerprint.

Link to this type sftp_option() View Source
sftp_option() ::
  {:host, String.t()}
  | {:port, integer()}
  | {:user, String.t()}
  | {:password, String.t()}
  | {:user_key, user_key()}
  | {:host_key, host_key()}
  | {:verify_host_key, boolean()}
  | {:directory, String.t()}
  | {:base_url, String.t()}

Options for creating an SFTP provider.

Private key or private key PEM string.

Link to this section Functions

Link to this function default(options \\ []) View Source
default([sftp_option()]) ::
  {:ok, Belt.Provider.configuration()} | {:error, term()}

Creates a new SFTP provider configuration with default credentials.

Any provided options override the default settings which are retrieved from the application configuration.

Example

# config.exs
config :belt, Belt.Provider.SFTP,
default: [
  host: "example.org",
  user: "foo",
  password: "bar"]
Link to this function delete(config, identifier, options) View Source

Implementation of the Provider.delete/3 callback.

Link to this function delete_all(config, options) View Source

Implementation of the Provider.delete_all/2 callback.

Link to this function delete_scope(config, scope, options) View Source

Implementation of the Provider.delete_scope/3 callback.

Link to this function get_info(config, identifier, options) View Source

Implementation of the Provider.get_info/3 callback.

Link to this function get_remote_hashes(channel, path, hashes) View Source
Link to this function get_url(arg1, identifier, arg3) View Source

Implementation of the Belt.Provider.get_url/3 callback.

Link to this function list_files(config, options) View Source

Implementation of the Belt.Provider.list_files/2 callback.

Creates a new SFTP provider configuration.

Options

  • base_url - String.t: Used for generating file URLs.
  • directory - String.t: Directory on the SFTP server. Defaults to “.” which refers to the working directory set by the server.
  • host - String.t: Hostname of the SFTP server.
  • host_key - Belt.Provider.SFTP.host_key: Fingerprint of the SFTP server. Can be traditional colon-separated MD5 fingerprint string or an OpenSSL-formatted string such as "SHA256:aZGX[…]JePQ".
  • password - String.t: Password for authentication. Needs to be combined with user option.
  • port - integer: Port of the SFTP server. Defaults to 22.
  • verify_host_key - boolean: Whether the host key should be verified. Defaults to true.
  • user - String.t: Username for authentication. Needs to be combined with password option.
  • user_key - Belt.Provider.SFTP.user_key: Private key for authentication. Can be a :public_key.private_key record or a PEM certificate string.
Link to this function store(config, file_source, options) View Source

Implementation of the Provider.store/3 callback.

Link to this function store_data(config, iodata, options) View Source

Implementation of the Provider.store_data/3 callback.

Link to this function test_connection(config, options) View Source

Implementation of the Provider.test_connection/2 callback.