Spectre.Stack.Package (Spectre v0.3.0)

Copy Markdown View Source

Versioned, immutable manifest published by a Stack-installable package.

A package manifest describes what can be installed. It does not contain provider processes, credentials, clients, or any other runtime handle.

Summary

Functions

Returns whether the package accepts the supplied Spectre release.

Returns the stable identifier represented by a capability entry.

Normalizes and validates a manifest returned by package_module.

Types

t()

@type t() :: %Spectre.Stack.Package{
  actions: [term()],
  agent_extensions: [module()],
  conflicts: [term()],
  contract: pos_integer(),
  digest: String.t() | nil,
  dsl: module() | nil,
  id: term(),
  metadata: map(),
  module: module(),
  operations: [term()],
  provides: [term()],
  requires: [term()],
  resources: [term()],
  spectre: String.t(),
  version: String.t()
}

Functions

compatible?(package, core_version)

@spec compatible?(t(), String.t()) :: boolean()

Returns whether the package accepts the supplied Spectre release.

entry_id(entry)

@spec entry_id(term()) :: term()

Returns the stable identifier represented by a capability entry.

new!(package_module, manifest)

@spec new!(module(), t() | map() | keyword()) :: t()

Normalizes and validates a manifest returned by package_module.

The owning module is supplied by the core and cannot be forged by a manifest callback.