Add docs to modules that were missing them

pull/974/head
Rick Carlino 2019-03-25 13:50:34 -05:00 committed by Connor Rigby
parent 0a55aa4cc3
commit 673d8a834c
No known key found for this signature in database
GPG Key ID: 29A88B24B70456E0
16 changed files with 71 additions and 3 deletions

View File

@ -1,4 +1,10 @@
defmodule FarmbotCore.Asset do
@moduledoc """
Top level module, with some helpers. Persists application resources to disk.
Submodules of this module usually (but not always) correspond to a
resource in the REST API. See official REST API docs for details.
"""
alias FarmbotCore.Asset.{
Repo,
Device,

View File

@ -1,7 +1,8 @@
defmodule FarmbotCore.Asset.DiagnosticDump do
@moduledoc """
Just the DiagDump REST resource, used by FarmBot staff to help users debug
remote device problems.
"""
use FarmbotCore.Asset.Schema, path: "/api/diagnostic_dumps"
schema "diagnostic_dumps" do

View File

@ -111,7 +111,8 @@ defmodule FarmbotCore.AssetMonitor do
defp assert_result!(:ignore, _), do: :ok
defp assert_result!({:ok, _}, _), do: :ok
defp assert_result!(_, asset), do: exit("Failed to start or update child: #{inspect(asset)}")
defp assert_result!(_, asset),
do: exit("Failed to start or update child: #{inspect(asset)}")
def order,
do: [

View File

@ -1,4 +1,8 @@
defmodule FarmbotCore.AssetSupervisor do
@moduledoc """
Supervises all database-backed records.
"""
use Supervisor
alias FarmbotCore.{Asset.Repo, AssetWorker}

View File

@ -1,4 +1,6 @@
defprotocol FarmbotCore.AssetWorker do
# A process that represents a single database row.
@doc "List of relational resources that need to be preloaded."
def preload(asset)

View File

@ -1,4 +1,9 @@
defmodule FarmbotCore.BotStateNG do
@moduledoc """
The data strucutre behind the bot state tree (not the living process).
Also has some helpers for batching changes.
"""
alias FarmbotCore.{
BotStateNG,
BotStateNG.McuParams,

View File

@ -1,4 +1,11 @@
defmodule FarmbotCore.BotStateNG.Schema2Docs do
@moduledoc """
Turns the bot state tree schema into a typescript interface file.
As of 26 March 19, it is incomplete
"""
#TODO(RickCarlino): Complete this module
alias FarmbotCore.BotStateNG
def schema_to_ts do

View File

@ -1,6 +1,12 @@
defmodule FarmbotCore.EnigmaHandler do
@moduledoc """
Registers and deregisters a function that fires when an Enigma is created or
destroyed.
"""
use GenServer
# TODO(RickCarlino): Remote type does not exist. FIXME
@type enigma :: FarmbotCore.Assets.Private.Enigma.t()
@doc """

View File

@ -1,4 +1,8 @@
defmodule FarmbotCore.StorageSupervisor do
@moduledoc """
Top-level supervisor for REST resources (Asset), configs and the logger.
"""
use Supervisor
def start_link(args) do
@ -13,4 +17,4 @@ defmodule FarmbotCore.StorageSupervisor do
]
Supervisor.init(children, [strategy: :one_for_one])
end
end
end

View File

@ -1,4 +1,10 @@
defmodule FarmbotExt.AMQP.AutoSyncTransport do
@moduledoc """
This module provides an AMQP channel for
auto-sync messages from the FarmBot API.
SEE:
https://developer.farm.bot/docs/realtime-updates-auto-sync#section-example-auto-sync-subscriptions
"""
use GenServer
use AMQP

View File

@ -1,4 +1,8 @@
defmodule FarmbotExt.AMQP.BotStateTransport do
@moduledoc """
Responsible for broadcasting the bot state tree over AMQP/MQTT
"""
use GenServer
use AMQP
alias AMQP.Channel

View File

@ -1,4 +1,8 @@
defmodule FarmbotExt.AMQP.CeleryScriptTransport do
@moduledoc """
Handles inbound CeleryScript RPCs (from user via AMQP/MQTT).
"""
use GenServer
use AMQP

View File

@ -1,4 +1,8 @@
defmodule FarmbotExt.AMQP.ConnectionWorker do
@moduledoc """
Manages the AMQP socket lifecycle.
"""
use GenServer
alias FarmbotCore.Project
alias FarmbotExt.JWT

View File

@ -1,4 +1,8 @@
defmodule FarmbotExt.AMQP.LogTransport do
@moduledoc """
Handler for AMQP log channel
"""
use GenServer
use AMQP
alias AMQP.Channel

View File

@ -1,5 +1,8 @@
defmodule FarmbotOS.Init.FSCheckup do
@moduledoc false
# Performs a filesystem checkup and formats the
# volume on first boot.
use Supervisor
require Logger

View File

@ -1,4 +1,11 @@
defmodule FarmbotOS.Init.Supervisor do
@moduledoc """
All the stuff that needs to start before
FarmBotOS gets supervised by this one.
Handles boot logic for FBOS (on host vs. RPi).
"""
use Supervisor
def start_link(args) do