HostKit.Resources.ConfigFile (host_kit v0.1.0-beta.7)

Copy Markdown View Source

Structured INI/YAML/TOML config rendered to a managed file.

Summary

Types

content()

@type content() :: map() | keyword()

format()

@type format() :: :ini | :yaml | :toml

t()

@type t() :: %HostKit.Resources.ConfigFile{
  content: content(),
  depends_on: [term()],
  format: format(),
  group: String.t() | nil,
  meta: map(),
  mode: non_neg_integer() | nil,
  owner: String.t() | nil,
  path: String.t()
}

Functions

changed_public_entries(desired, actual_entries)

@spec changed_public_entries(t(), map() | :invalid | nil) :: [map()]

changed_public_paths(desired, actual_entries)

@spec changed_public_paths(t(), map()) :: [String.t()]

id(config_file)

new(path, format, opts \\ [])

@spec new(String.t(), format(), keyword()) :: t()

public_entries(config_file)

@spec public_entries(t()) :: map()

public_entries_from_content(desired, content)

@spec public_entries_from_content(t(), String.t()) :: {:ok, map()} | {:error, term()}

render(config_file)

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

secret?(config_file)

@spec secret?(t()) :: boolean()

secret_path_segments(config_file)

@spec secret_path_segments(t()) :: [[String.t() | integer()]]

secret_paths(config)

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