FindSiteIcon.Util.IconUtils (FindSiteIcon v0.4.0) View Source

Utilities for working with icon info

Link to this section Summary

Link to this section Functions

Specs

expired?(any()) :: boolean()
Link to this function

extract_header(headers, header_name)

View Source

Specs

extract_header([{binary(), binary()}], binary()) :: binary() | nil
Link to this function

generate_expiration_timestamp(cache_control)

View Source

Specs

generate_expiration_timestamp(any()) :: DateTime.t()
Link to this function

generate_info(arg1, icon_url)

View Source

Specs

generate_info(
  {:ok,
   %Tesla.Env{
     __client__: term(),
     __module__: term(),
     body: term(),
     headers: term(),
     method: term(),
     opts: term(),
     query: term(),
     status: term(),
     url: term()
   }}
  | nil,
  binary()
) ::
  %FindSiteIcon.IconInfo{
    expiration_timestamp: term(),
    size: term(),
    url: term()
  }
  | nil
Link to this function

generate_size(content_length)

View Source

Specs

generate_size(any()) :: integer() | nil

Specs

icon_info_for(binary() | nil) ::
  %FindSiteIcon.IconInfo{
    expiration_timestamp: term(),
    size: term(),
    url: term()
  }
  | nil
Link to this function

reject_bad_content_type(response)

View Source

Specs

reject_bad_content_type(any()) ::
  nil
  | {:ok,
     %Tesla.Env{
       __client__: term(),
       __module__: term(),
       body: term(),
       headers: term(),
       method: term(),
       opts: term(),
       query: term(),
       status: term(),
       url: term()
     }}

Specs

unexpired?(any()) :: boolean()