Temper.Push.Destination (temper v0.4.0)

Copy Markdown View Source

Resolves where mix temper.push sends history, from config :temper, :push and the task's flags.

A preset fills in the adapter and its options (see resolve/2 for what wins over what). The one preset today:

Without an adapter (explicit or from a preset) there is no destination: Temper never picks one on its own.

Pure: the caller passes the configuration in.

Summary

Functions

The preset names Temper knows.

The adapter and its config. config is config :temper, :push; flags may carry :preset and :url from the command line.

Functions

presets()

@spec presets() :: [String.t()]

The preset names Temper knows.

resolve(config, flags)

@spec resolve(keyword(), keyword()) ::
  {:ok, module(), keyword()} | {:error, String.t()}

The adapter and its config. config is config :temper, :push; flags may carry :preset and :url from the command line.

Precedence, lowest first: a preset named in the config, the config itself, a preset named by flag, the --url flag. So --preset sinter sends to Sinter whatever the config says, while a config that names a preset can still change its url or token variable.