Settings (fnord v0.7.16)

View Source

Summary

Functions

Delete a value from the settings store.

Get a value from the settings store.

Get the project specified with --project. If the project name is not set, an error will be raised.

Get the path to the store root directory.

Set a value in the settings store.

Get the path to the settings file. If the file does not exist, it will be created.

Types

t()

@type t() :: %Settings{data: term(), path: term()}

Functions

delete(settings, key)

@spec delete(t(), String.t()) :: t()

Delete a value from the settings store.

get(settings, key, default \\ nil)

@spec get(t(), String.t(), any()) :: any()

Get a value from the settings store.

get_project(settings)

@spec get_project(t()) :: {:ok, map()} | {:error, :not_found}

get_root(settings)

@spec get_root(t()) :: {:ok, String.t()} | {:error, :not_found}

get_selected_project!()

@spec get_selected_project!() :: String.t()

Get the project specified with --project. If the project name is not set, an error will be raised.

home()

@spec home() :: String.t()

Get the path to the store root directory.

list_projects(settings)

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

new()

@spec new() :: t()

set(settings, key, value)

@spec set(t(), String.t(), any()) :: t()

Set a value in the settings store.

set_project(settings, data)

@spec set_project(t(), map()) :: map()

settings_file()

@spec settings_file() :: String.t()

Get the path to the settings file. If the file does not exist, it will be created.