Settings (fnord v0.8.13)

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 tuple is returned.

Get the path to the store root directory.

Check if the --project option is set.

Set a value in the settings store.

Set the project name for the --project option.

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(), binary()) :: t()

Delete a value from the settings store.

get(settings, key, default \\ nil)

@spec get(t(), binary(), any()) :: any()

Get a value from the settings store.

get_project(settings)

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

get_root(settings)

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

get_selected_project()

@spec get_selected_project() :: {:ok, binary()} | {:error, :project_not_set}

Get the project specified with --project. If the project name is not set, an error tuple is returned.

home()

@spec home() :: binary()

Get the path to the store root directory.

list_projects(settings)

@spec list_projects(t()) :: [binary()]

new()

@spec new() :: t()

project_is_set?()

Check if the --project option is set.

set(settings, key, value)

@spec set(t(), binary(), any()) :: t()

Set a value in the settings store.

set_project(project_name)

@spec set_project(binary()) :: :ok

Set the project name for the --project option.

set_project(settings, data)

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

settings_file()

@spec settings_file() :: binary()

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