HostKit (host_kit v0.1.0-beta.1)

Copy Markdown View Source

Elixir-native host infrastructure declarations, planning, and runtime control.

HostKit keeps systemd and transient unit execution as core primitives while integrations such as Caddy are provided by providers. DSL files compile to plain structs that can be inspected and consumed through the runtime API.

Summary

Functions

Applies supported changes from a HostKit plan.

Applies supported changes from a HostKit plan or raises.

Builds a down/rollback plan from an existing HostKit plan.

Formats a HostKit plan for human-readable output.

Loads a HostKit project from an .exs file.

Loads a HostKit project from an .exs file or raises.

Builds an initial plan from project resources.

Applies the down/rollback plan for an existing HostKit plan.

Functions

apply(plan, opts \\ [])

@spec apply(
  HostKit.Plan.t(),
  keyword()
) :: {:ok, [HostKit.Apply.result()]} | {:error, term()}

Applies supported changes from a HostKit plan.

apply!(plan, opts \\ [])

@spec apply!(
  HostKit.Plan.t(),
  keyword()
) :: [HostKit.Apply.result()]

Applies supported changes from a HostKit plan or raises.

down(plan, opts \\ [])

@spec down(
  HostKit.Plan.t(),
  keyword()
) :: {:ok, HostKit.Plan.t()} | {:error, term()}

Builds a down/rollback plan from an existing HostKit plan.

format_plan(plan)

@spec format_plan(HostKit.Plan.t()) :: String.t()

Formats a HostKit plan for human-readable output.

load(path, opts \\ [])

@spec load(
  Path.t(),
  keyword()
) :: {:ok, HostKit.Project.t()} | {:error, term()}

Loads a HostKit project from an .exs file.

load!(path, opts \\ [])

@spec load!(
  Path.t(),
  keyword()
) :: HostKit.Project.t()

Loads a HostKit project from an .exs file or raises.

plan(project, opts \\ [])

@spec plan(
  HostKit.Project.t(),
  keyword()
) :: {:ok, HostKit.Plan.t()} | {:error, HostKit.Diagnostics.t() | term()}

Builds an initial plan from project resources.

This first implementation is intentionally structural: it preserves resources and dependency ordering without touching a host.

rollback(plan, opts \\ [])

@spec rollback(
  HostKit.Plan.t(),
  keyword()
) :: {:ok, [HostKit.Apply.result()]} | {:error, term()}

Applies the down/rollback plan for an existing HostKit plan.