First pass at uniformed types, specs and docs

- spec public functions (skipping controllers, views, live views and
components)
- use types instead of explanations in docs
- remove redundant docs
- fix typos
This commit is contained in:
Claudio Ortolina
2026-03-06 08:33:11 +00:00
parent 99e30d5fdf
commit 7cf9b4e7f8
81 changed files with 652 additions and 300 deletions
+3
View File
@@ -2,16 +2,19 @@ defmodule MusicLibrary.Secrets do
alias MusicLibrary.Repo
alias MusicLibrary.Secrets.Secret
@spec store(String.t(), String.t()) :: {:ok, Secret.t()} | {:error, Ecto.Changeset.t()}
def store(name, value) do
%Secret{}
|> Secret.changeset(%{name: name, value: value})
|> Repo.insert(on_conflict: :replace_all)
end
@spec get!(String.t()) :: Secret.t()
def get!(name) do
Repo.get!(Secret, name)
end
@spec get(String.t()) :: Secret.t() | nil
def get(name) do
Repo.get(Secret, name)
end