Sexy.TDL.Binary (Sexy v0.11.0)

Copy Markdown View Source

Resolves the tdlib_json_cli executable for the current platform.

Resolution order (first hit wins):

  1. config :sexy, :tdlib_binary — authoritative override. A broken configured path fails at port open; it never falls through to auto-detection.
  2. SEXY_TDLIB_PATH environment variable — same authority, for deployments where app config is inconvenient.
  3. Per-user cache: <user cache>/sexy/tdlib_json_cli-<tdlib version>-<target>, filled by ensure_installed/0.

ensure_installed/0 runs once at Sexy.TDL supervisor start (and from mix sexy.tdl.install): it downloads the platform binary from the GitHub release pinned in priv/tdlib/manifest.json and verifies its sha256. resolve!/0 never touches the network — it runs on every port restart.

Summary

Functions

Idempotent: download the pinned binary unless already resolvable.

The pinned-release manifest shipped with the package.

Path to the binary. Pure lookup, raises with instructions when absent.

Release target for this machine, e.g. "linux-x64" or "macos-arm64".

Functions

ensure_installed()

@spec ensure_installed() :: :ok | {:error, String.t()}

Idempotent: download the pinned binary unless already resolvable.

manifest()

@spec manifest() :: map()

The pinned-release manifest shipped with the package.

resolve!()

@spec resolve!() :: String.t()

Path to the binary. Pure lookup, raises with instructions when absent.

target()

@spec target() :: String.t()

Release target for this machine, e.g. "linux-x64" or "macos-arm64".