gftp/utils

Values

pub fn extract_str(
  body: String,
  token: String,
) -> Result(String, Nil)

Get the substring enclosed in the provided token.

pub fn parse_int(s: String) -> Result(Int, result.FtpError)

A helper function to parse a string into an integer, returning an ftp error if the parsing fails.

pub fn parse_month(
  s: String,
) -> Result(calendar.Month, result.FtpError)

A helper function to parse a string into a Month

pub fn re_matches(
  re: regexp.Regexp,
  line: String,
) -> Result(List(option.Option(String)), Nil)

A helper function to match a regular expression against a string and extract the submatches as a list of strings.

pub fn response_to_string(
  response: response.Response,
) -> Result(String, result.FtpError)

A helper function to convert a Response to a String, returning an ftp error if the conversion fails.

Search Document