NBPR.Package.Daemon (NBPR v0.2.0)

Copy Markdown View Source

Metadata struct for a single daemon declared by an NBPR package.

argv_template is an MFA tuple. The function is invoked as module.function(validated_opts, opt_flags, *extra_args) and must return a list of strings (the argv). Defaults to {NBPR.BrPackage, :default_argv, []}, which performs mechanical [flag, value] zipping over the runtime opts. Packages with subcommand or positional-argv daemons override with their own MFA.

Summary

Types

mfa_tuple()

@type mfa_tuple() :: {module(), atom(), [term()]}

t()

@type t() :: %NBPR.Package.Daemon{
  argv_template: mfa_tuple(),
  module: module(),
  name: atom(),
  opt_flags: %{required(atom()) => String.t()},
  opts: keyword(),
  path: String.t()
}