mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-09-20 10:05:57 +08:00
parent
4d76c57530
commit
64dad900d7
|
@ -1,5 +1,4 @@
|
||||||
defmodule LivebookSpace.Application do
|
defmodule LivebookSpace.Application do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
use Application
|
use Application
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
defmodule Livebook do
|
defmodule Livebook do
|
||||||
@moduledoc """
|
@moduledoc """
|
||||||
Livebook is an interactive notebook system for Elixir.
|
This module provides a public Elixir API for integrating with Livebook.
|
||||||
|
|
||||||
This module includes the public API.
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.App do
|
defmodule Livebook.App do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Process corresponding to a deployed app, orchestrating app sessions.
|
# Process corresponding to a deployed app, orchestrating app sessions.
|
||||||
#
|
#
|
||||||
# An app process is identified by a user-defined slug, which also
|
# An app process is identified by a user-defined slug, which also
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Application do
|
defmodule Livebook.Application do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
use Application
|
use Application
|
||||||
|
|
||||||
def start(_type, _args) do
|
def start(_type, _args) do
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Apps do
|
defmodule Livebook.Apps do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# This module is responsible for starting and discovering apps.
|
# This module is responsible for starting and discovering apps.
|
||||||
#
|
#
|
||||||
# App processes are tracked using `Livebook.Tracker` in the same way
|
# App processes are tracked using `Livebook.Tracker` in the same way
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Config do
|
defmodule Livebook.Config do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
alias Livebook.FileSystem
|
alias Livebook.FileSystem
|
||||||
|
|
||||||
@type auth_mode() :: :token | :password | :disabled
|
@type auth_mode() :: :token | :password | :disabled
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Delta do
|
defmodule Livebook.Delta do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Delta is a format used to represent a set of changes introduced
|
# Delta is a format used to represent a set of changes introduced
|
||||||
# to a text document.
|
# to a text document.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Delta.Operation do
|
defmodule Livebook.Delta.Operation do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# An operation represents an atomic change applicable to a text.
|
# An operation represents an atomic change applicable to a text.
|
||||||
#
|
#
|
||||||
# For plain-text (our use case) an operation can be either of:
|
# For plain-text (our use case) an operation can be either of:
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Delta.Transformation do
|
defmodule Livebook.Delta.Transformation do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Implementation of the Operational Transformation algorithm for
|
# Implementation of the Operational Transformation algorithm for
|
||||||
# deltas.
|
# deltas.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.EctoTypes.HexColor do
|
defmodule Livebook.EctoTypes.HexColor do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
use Ecto.Type
|
use Ecto.Type
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defprotocol Livebook.FileSystem do
|
defprotocol Livebook.FileSystem do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# This protocol defines an interface for a virtual file system that
|
# This protocol defines an interface for a virtual file system that
|
||||||
# can be plugged into Livebook.
|
# can be plugged into Livebook.
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.FileSystem.File do
|
defmodule Livebook.FileSystem.File do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# A file points to a specific location in the given file system.
|
# A file points to a specific location in the given file system.
|
||||||
#
|
#
|
||||||
# This module provides a number of high-level functions similar to
|
# This module provides a number of high-level functions similar to
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.FileSystem.Local do
|
defmodule Livebook.FileSystem.Local do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# File system backed by local disk.
|
# File system backed by local disk.
|
||||||
|
|
||||||
defstruct [:origin_pid, :default_path, id: "local"]
|
defstruct [:origin_pid, :default_path, id: "local"]
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
defmodule Livebook.FileSystem.S3 do
|
defmodule Livebook.FileSystem.S3 do
|
||||||
@moduledoc false
|
|
||||||
use Ecto.Schema
|
use Ecto.Schema
|
||||||
import Ecto.Changeset
|
import Ecto.Changeset
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.FileSystem.S3.Client do
|
defmodule Livebook.FileSystem.S3.Client do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
alias Livebook.FileSystem
|
alias Livebook.FileSystem
|
||||||
alias Livebook.FileSystem.S3
|
alias Livebook.FileSystem.S3
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.FileSystem.S3.XML do
|
defmodule Livebook.FileSystem.S3.XML do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Adapted from https://github.com/aws-beam/aws-elixir/blob/v0.8.0/lib/aws/xml.ex
|
# Adapted from https://github.com/aws-beam/aws-elixir/blob/v0.8.0/lib/aws/xml.ex
|
||||||
|
|
||||||
import Record
|
import Record
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.FileSystem.Utils do
|
defmodule Livebook.FileSystem.Utils do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
alias Livebook.FileSystem
|
alias Livebook.FileSystem
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.FileSystems do
|
defmodule Livebook.FileSystems do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
alias Livebook.FileSystem
|
alias Livebook.FileSystem
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Hubs do
|
defmodule Livebook.Hubs do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
alias Livebook.FileSystem
|
alias Livebook.FileSystem
|
||||||
alias Livebook.Storage
|
alias Livebook.Storage
|
||||||
alias Livebook.Hubs.{Broadcasts, Metadata, Personal, Provider, Team}
|
alias Livebook.Hubs.{Broadcasts, Metadata, Personal, Provider, Team}
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Hubs.Broadcasts do
|
defmodule Livebook.Hubs.Broadcasts do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
alias Livebook.FileSystem
|
alias Livebook.FileSystem
|
||||||
alias Livebook.Secrets.Secret
|
alias Livebook.Secrets.Secret
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Hubs.Metadata do
|
defmodule Livebook.Hubs.Metadata do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
defstruct [:id, :name, :provider, :emoji, connected?: false]
|
defstruct [:id, :name, :provider, :emoji, connected?: false]
|
||||||
|
|
||||||
@type t :: %__MODULE__{
|
@type t :: %__MODULE__{
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Hubs.Personal do
|
defmodule Livebook.Hubs.Personal do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
use Ecto.Schema
|
use Ecto.Schema
|
||||||
import Ecto.Changeset
|
import Ecto.Changeset
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defprotocol Livebook.Hubs.Provider do
|
defprotocol Livebook.Hubs.Provider do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
alias Livebook.FileSystem
|
alias Livebook.FileSystem
|
||||||
alias Livebook.Secrets.Secret
|
alias Livebook.Secrets.Secret
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
defmodule Livebook.Hubs.Team do
|
defmodule Livebook.Hubs.Team do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
use Ecto.Schema
|
use Ecto.Schema
|
||||||
import Ecto.Changeset
|
import Ecto.Changeset
|
||||||
|
|
||||||
defmodule Offline do
|
defmodule Offline do
|
||||||
@moduledoc false
|
|
||||||
use Ecto.Schema
|
use Ecto.Schema
|
||||||
|
|
||||||
alias Livebook.Secrets.Secret
|
alias Livebook.Secrets.Secret
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
defmodule Livebook.Hubs.TeamClient do
|
defmodule Livebook.Hubs.TeamClient do
|
||||||
@moduledoc false
|
|
||||||
use GenServer
|
use GenServer
|
||||||
require Logger
|
require Logger
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Intellisense do
|
defmodule Livebook.Intellisense do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# This module provides intellisense related operations suitable for
|
# This module provides intellisense related operations suitable for
|
||||||
# integration with a text editor.
|
# integration with a text editor.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Intellisense.Docs do
|
defmodule Livebook.Intellisense.Docs do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# This module is responsible for extracting and normalizing
|
# This module is responsible for extracting and normalizing
|
||||||
# information like documentation, signatures and specs.
|
# information like documentation, signatures and specs.
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Intellisense.IdentifierMatcher do
|
defmodule Livebook.Intellisense.IdentifierMatcher do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# This module allows for extracting information about identifiers
|
# This module allows for extracting information about identifiers
|
||||||
# based on code and runtime information (binding, environment).
|
# based on code and runtime information (binding, environment).
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Intellisense.SignatureMatcher do
|
defmodule Livebook.Intellisense.SignatureMatcher do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# This module allows for extracting information about function
|
# This module allows for extracting information about function
|
||||||
# signatures matching an incomplete call.
|
# signatures matching an incomplete call.
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.JSInterop do
|
defmodule Livebook.JSInterop do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
alias Livebook.Delta
|
alias Livebook.Delta
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.LiveMarkdown do
|
defmodule Livebook.LiveMarkdown do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# File format used to store Livebook notebooks.
|
# File format used to store Livebook notebooks.
|
||||||
#
|
#
|
||||||
# The format is a subset of Markdown, which means that every Live
|
# The format is a subset of Markdown, which means that every Live
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.LiveMarkdown.MarkdownHelpers do
|
defmodule Livebook.LiveMarkdown.MarkdownHelpers do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Wraps `EarmarkParser.as_ast/2`.
|
Wraps `EarmarkParser.as_ast/2`.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Migration do
|
defmodule Livebook.Migration do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Runs all migrations.
|
Runs all migrations.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Notebook do
|
defmodule Livebook.Notebook do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Data structure representing a notebook.
|
# Data structure representing a notebook.
|
||||||
#
|
#
|
||||||
# A notebook is just a document and roughly maps to a plain file
|
# A notebook is just a document and roughly maps to a plain file
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Notebook.AppSettings do
|
defmodule Livebook.Notebook.AppSettings do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Data structure configuring how notebook gets deployed as an app.
|
# Data structure configuring how notebook gets deployed as an app.
|
||||||
|
|
||||||
use Ecto.Schema
|
use Ecto.Schema
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Notebook.Cell do
|
defmodule Livebook.Notebook.Cell do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Data structure representing a single cell in a notebook.
|
# Data structure representing a single cell in a notebook.
|
||||||
#
|
#
|
||||||
# Cell is the smallest structural unit in a notebook, in other words
|
# Cell is the smallest structural unit in a notebook, in other words
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Notebook.Cell.Code do
|
defmodule Livebook.Notebook.Cell.Code do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Notebook cell with evaluable code.
|
# Notebook cell with evaluable code.
|
||||||
#
|
#
|
||||||
# It consists of text content that the user can edit and produces
|
# It consists of text content that the user can edit and produces
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Notebook.Cell.Markdown do
|
defmodule Livebook.Notebook.Cell.Markdown do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Notebook cell with Markdown text content.
|
# Notebook cell with Markdown text content.
|
||||||
#
|
#
|
||||||
# It consists of text content that the user can edit and which is
|
# It consists of text content that the user can edit and which is
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Notebook.Cell.Smart do
|
defmodule Livebook.Notebook.Cell.Smart do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# A cell with evaluable code that is edited through a dedicated UI.
|
# A cell with evaluable code that is edited through a dedicated UI.
|
||||||
#
|
#
|
||||||
# Smart cell is supposed to provide the user with an easy, code-free
|
# Smart cell is supposed to provide the user with an easy, code-free
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Notebook.ContentLoader do
|
defmodule Livebook.Notebook.ContentLoader do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
alias Livebook.Utils.HTTP
|
alias Livebook.Utils.HTTP
|
||||||
|
|
||||||
@typedoc """
|
@typedoc """
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
defmodule Livebook.Notebook.Learn do
|
defmodule Livebook.Notebook.Learn do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
defmodule NotFoundError do
|
defmodule NotFoundError do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
defexception [:slug, plug_status: 404]
|
defexception [:slug, plug_status: 404]
|
||||||
|
|
||||||
def message(%{slug: slug}) do
|
def message(%{slug: slug}) do
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Notebook.Section do
|
defmodule Livebook.Notebook.Section do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Data structure representing a single section in a notebook.
|
# Data structure representing a single section in a notebook.
|
||||||
#
|
#
|
||||||
# Section can contains a number of cells and serves as a way of
|
# Section can contains a number of cells and serves as a way of
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.NotebookManager do
|
defmodule Livebook.NotebookManager do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
use GenServer
|
use GenServer
|
||||||
|
|
||||||
alias Livebook.Storage
|
alias Livebook.Storage
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Release do
|
defmodule Livebook.Release do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Runs the setup for all apps deployed from directory on startup.
|
Runs the setup for all apps deployed from directory on startup.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defprotocol Livebook.Runtime do
|
defprotocol Livebook.Runtime do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# This protocol defines an interface for code evaluation backends.
|
# This protocol defines an interface for code evaluation backends.
|
||||||
#
|
#
|
||||||
# Usually a runtime involves a set of processes responsible for
|
# Usually a runtime involves a set of processes responsible for
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Runtime.Attached do
|
defmodule Livebook.Runtime.Attached do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# A runtime backed by an Elixir node managed externally.
|
# A runtime backed by an Elixir node managed externally.
|
||||||
#
|
#
|
||||||
# Such node must be already started and available, Livebook doesn't
|
# Such node must be already started and available, Livebook doesn't
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Runtime.Definitions do
|
defmodule Livebook.Runtime.Definitions do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
kino = %{
|
kino = %{
|
||||||
name: "kino",
|
name: "kino",
|
||||||
dependency: %{dep: {:kino, github: "livebook-dev/kino", override: true}, config: []}
|
dependency: %{dep: {:kino, github: "livebook-dev/kino", override: true}, config: []}
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Runtime.Dependencies do
|
defmodule Livebook.Runtime.Dependencies do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Adds the given list of dependencies to the setup code.
|
Adds the given list of dependencies to the setup code.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Runtime.Embedded do
|
defmodule Livebook.Runtime.Embedded do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# A runtime backed by the same node Livebook is running in.
|
# A runtime backed by the same node Livebook is running in.
|
||||||
#
|
#
|
||||||
# This runtime is reserved for specific use cases, where there is
|
# This runtime is reserved for specific use cases, where there is
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Runtime.ErlDist do
|
defmodule Livebook.Runtime.ErlDist do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# This module allows for initializing connected runtime nodes with
|
# This module allows for initializing connected runtime nodes with
|
||||||
# modules and processes necessary for evaluation.
|
# modules and processes necessary for evaluation.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Runtime.ErlDist.EvaluatorSupervisor do
|
defmodule Livebook.Runtime.ErlDist.EvaluatorSupervisor do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Supervisor responsible for dynamically spawning
|
# Supervisor responsible for dynamically spawning
|
||||||
# and terminating evaluator server processes.
|
# and terminating evaluator server processes.
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Runtime.ErlDist.IOForwardGL do
|
defmodule Livebook.Runtime.ErlDist.IOForwardGL do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# An IO device process forwarding all requests to sender's group
|
# An IO device process forwarding all requests to sender's group
|
||||||
# leader.
|
# leader.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Runtime.ErlDist.LoggerGLBackend do
|
defmodule Livebook.Runtime.ErlDist.LoggerGLBackend do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# A logger backend used to forward logs to Livebook,
|
# A logger backend used to forward logs to Livebook,
|
||||||
# as with regular output.
|
# as with regular output.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Runtime.ErlDist.LoggerGLHandler do
|
defmodule Livebook.Runtime.ErlDist.LoggerGLHandler do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
@doc false
|
@doc false
|
||||||
def log(%{meta: meta} = event, %{formatter: {formatter_module, formatter_config}}) do
|
def log(%{meta: meta} = event, %{formatter: {formatter_module, formatter_config}}) do
|
||||||
message = apply(formatter_module, :format, [event, formatter_config])
|
message = apply(formatter_module, :format, [event, formatter_config])
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Runtime.ErlDist.NodeManager do
|
defmodule Livebook.Runtime.ErlDist.NodeManager do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# The primary Livebook process started on a remote node.
|
# The primary Livebook process started on a remote node.
|
||||||
#
|
#
|
||||||
# This process is responsible for initializing the node with necessary
|
# This process is responsible for initializing the node with necessary
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Runtime.ErlDist.RuntimeServer do
|
defmodule Livebook.Runtime.ErlDist.RuntimeServer do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# A server process backing a specific runtime.
|
# A server process backing a specific runtime.
|
||||||
#
|
#
|
||||||
# This process handles `Livebook.Runtime` operations,
|
# This process handles `Livebook.Runtime` operations,
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Runtime.ErlDist.Sink do
|
defmodule Livebook.Runtime.ErlDist.Sink do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# An idle process that ignores all incoming messages.
|
# An idle process that ignores all incoming messages.
|
||||||
|
|
||||||
use GenServer
|
use GenServer
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Runtime.ErlDist.SmartCellGL do
|
defmodule Livebook.Runtime.ErlDist.SmartCellGL do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
use GenServer
|
use GenServer
|
||||||
|
|
||||||
@spec start_link(pid()) :: GenServer.on_start()
|
@spec start_link(pid()) :: GenServer.on_start()
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Runtime.Evaluator do
|
defmodule Livebook.Runtime.Evaluator do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# A process responsible for evaluating notebook code.
|
# A process responsible for evaluating notebook code.
|
||||||
#
|
#
|
||||||
# When evaluator receives an evaluation request, it synchronously
|
# When evaluator receives an evaluation request, it synchronously
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Runtime.Evaluator.Doctests do
|
defmodule Livebook.Runtime.Evaluator.Doctests do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
@test_timeout 5_000
|
@test_timeout 5_000
|
||||||
@line_width 80
|
@line_width 80
|
||||||
@pad_size 3
|
@pad_size 3
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Runtime.Evaluator.Formatter do
|
defmodule Livebook.Runtime.Evaluator.Formatter do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
require Logger
|
require Logger
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Runtime.Evaluator.IOProxy do
|
defmodule Livebook.Runtime.Evaluator.IOProxy do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# An IO device process used by `Evaluator` as the group leader.
|
# An IO device process used by `Evaluator` as the group leader.
|
||||||
#
|
#
|
||||||
# The process implements [the Erlang I/O Protocol](https://erlang.org/doc/apps/stdlib/io_protocol.html)
|
# The process implements [the Erlang I/O Protocol](https://erlang.org/doc/apps/stdlib/io_protocol.html)
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Runtime.Evaluator.ObjectTracker do
|
defmodule Livebook.Runtime.Evaluator.ObjectTracker do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# This module is an abstraction for tracking objects,
|
# This module is an abstraction for tracking objects,
|
||||||
# references to them and garbage collection.
|
# references to them and garbage collection.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Runtime.Evaluator.Tracer do
|
defmodule Livebook.Runtime.Evaluator.Tracer do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Compilation tracer used by the evaluator.
|
# Compilation tracer used by the evaluator.
|
||||||
#
|
#
|
||||||
# Events are pre-processed and sent to the group leader, where the
|
# Events are pre-processed and sent to the group leader, where the
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
defmodule Livebook.Runtime.NodePool do
|
defmodule Livebook.Runtime.NodePool do
|
||||||
use GenServer
|
use GenServer
|
||||||
|
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# A pool with generated node names.
|
# A pool with generated node names.
|
||||||
#
|
#
|
||||||
# The names are randomly generated, however to avoid atom exhaustion
|
# The names are randomly generated, however to avoid atom exhaustion
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Runtime.StandaloneInit do
|
defmodule Livebook.Runtime.StandaloneInit do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Generic functionality related to starting and setting up
|
# Generic functionality related to starting and setting up
|
||||||
# a new Elixir system process. It's used by ElixirStandalone.
|
# a new Elixir system process. It's used by ElixirStandalone.
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
defmodule Livebook.Secrets do
|
defmodule Livebook.Secrets do
|
||||||
# Shared secret functionality across all hubs.
|
# Shared secret functionality across all hubs.
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
alias Livebook.Secrets.Secret
|
alias Livebook.Secrets.Secret
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
defmodule Livebook.Secrets.Secret do
|
defmodule Livebook.Secrets.Secret do
|
||||||
@moduledoc false
|
|
||||||
use Ecto.Schema
|
use Ecto.Schema
|
||||||
import Ecto.Changeset
|
import Ecto.Changeset
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Session do
|
defmodule Livebook.Session do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Server process representing a single notebook session.
|
# Server process representing a single notebook session.
|
||||||
#
|
#
|
||||||
# Session keeps a notebook document, as well as additional ephemeral
|
# Session keeps a notebook document, as well as additional ephemeral
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Session.Data do
|
defmodule Livebook.Session.Data do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Session data is a state shared across all of the clients.
|
# Session data is a state shared across all of the clients.
|
||||||
#
|
#
|
||||||
# In practice this structure is a `Notebook` decorated with all the
|
# In practice this structure is a `Notebook` decorated with all the
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Session.FileGuard do
|
defmodule Livebook.Session.FileGuard do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Serves as a locking mechanism for notebook files.
|
# Serves as a locking mechanism for notebook files.
|
||||||
#
|
#
|
||||||
# Every session process willing to persist notebook
|
# Every session process willing to persist notebook
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Session.Worker do
|
defmodule Livebook.Session.Worker do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# A dedicated process for offloading the session process,
|
# A dedicated process for offloading the session process,
|
||||||
# when the session state is not necessary.
|
# when the session state is not necessary.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Sessions do
|
defmodule Livebook.Sessions do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# This module is responsible for starting and discovering sessions.
|
# This module is responsible for starting and discovering sessions.
|
||||||
#
|
#
|
||||||
# Every session has a server process and is described by a `%Session{}`
|
# Every session has a server process and is described by a `%Session{}`
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Settings do
|
defmodule Livebook.Settings do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Keeps all Livebook settings that are backed by storage.
|
# Keeps all Livebook settings that are backed by storage.
|
||||||
|
|
||||||
import Ecto.Changeset, only: [apply_action: 2]
|
import Ecto.Changeset, only: [apply_action: 2]
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
defmodule Livebook.Settings.EnvVar do
|
defmodule Livebook.Settings.EnvVar do
|
||||||
@moduledoc false
|
|
||||||
use Ecto.Schema
|
use Ecto.Schema
|
||||||
import Ecto.Changeset
|
import Ecto.Changeset
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Stamping do
|
defmodule Livebook.Stamping do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Cryptographic functions used to implement notebook stamping.
|
# Cryptographic functions used to implement notebook stamping.
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Storage do
|
defmodule Livebook.Storage do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Storage for arbitrary data in [Entity-Attribute-Value](https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model)
|
# Storage for arbitrary data in [Entity-Attribute-Value](https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model)
|
||||||
# fashion.
|
# fashion.
|
||||||
#
|
#
|
||||||
|
@ -22,8 +20,6 @@ defmodule Livebook.Storage do
|
||||||
@type entity :: %{required(:id) => entity_id(), optional(attribute()) => value()}
|
@type entity :: %{required(:id) => entity_id(), optional(attribute()) => value()}
|
||||||
|
|
||||||
defmodule NotFoundError do
|
defmodule NotFoundError do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
defexception [:id, :namespace, plug_status: 404]
|
defexception [:id, :namespace, plug_status: 404]
|
||||||
|
|
||||||
def message(%{namespace: namespace, id: id}) do
|
def message(%{namespace: namespace, id: id}) do
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.SystemResources do
|
defmodule Livebook.SystemResources do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Periodically computes system resource usage.
|
# Periodically computes system resource usage.
|
||||||
|
|
||||||
@type memory :: %{total: non_neg_integer(), free: non_neg_integer()}
|
@type memory :: %{total: non_neg_integer(), free: non_neg_integer()}
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Teams do
|
defmodule Livebook.Teams do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
alias Livebook.{FileSystem, Hubs}
|
alias Livebook.{FileSystem, Hubs}
|
||||||
alias Livebook.Hubs.Team
|
alias Livebook.Hubs.Team
|
||||||
alias Livebook.Secrets.Secret
|
alias Livebook.Secrets.Secret
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Teams.Connection do
|
defmodule Livebook.Teams.Connection do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
@behaviour :gen_statem
|
@behaviour :gen_statem
|
||||||
|
|
||||||
require Logger
|
require Logger
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Teams.Org do
|
defmodule Livebook.Teams.Org do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
use Ecto.Schema
|
use Ecto.Schema
|
||||||
import Ecto.Changeset
|
import Ecto.Changeset
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Teams.Requests do
|
defmodule Livebook.Teams.Requests do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
alias Livebook.FileSystem
|
alias Livebook.FileSystem
|
||||||
alias Livebook.FileSystems
|
alias Livebook.FileSystems
|
||||||
alias Livebook.Hubs.Team
|
alias Livebook.Hubs.Team
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Teams.WebSocket do
|
defmodule Livebook.Teams.WebSocket do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
alias Mint.WebSocket.UpgradeFailureError
|
alias Mint.WebSocket.UpgradeFailureError
|
||||||
|
|
||||||
@ws_path "/user/websocket"
|
@ws_path "/user/websocket"
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Tracker do
|
defmodule Livebook.Tracker do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
use Phoenix.Tracker
|
use Phoenix.Tracker
|
||||||
|
|
||||||
alias Livebook.Session
|
alias Livebook.Session
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.UpdateCheck do
|
defmodule Livebook.UpdateCheck do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Periodically checks for available Livebook update.
|
# Periodically checks for available Livebook update.
|
||||||
|
|
||||||
use GenServer
|
use GenServer
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Users do
|
defmodule Livebook.Users do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
alias Livebook.Users.User
|
alias Livebook.Users.User
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Users.User do
|
defmodule Livebook.Users.User do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Represents a Livebook user.
|
# Represents a Livebook user.
|
||||||
#
|
#
|
||||||
# Livebook users are not regular web app accounts,
|
# Livebook users are not regular web app accounts,
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Utils do
|
defmodule Livebook.Utils do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
require Logger
|
require Logger
|
||||||
|
|
||||||
@type id :: binary()
|
@type id :: binary()
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Utils.ANSI do
|
defmodule Livebook.Utils.ANSI do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
@type modifiers :: list(modifier())
|
@type modifiers :: list(modifier())
|
||||||
|
|
||||||
@type modifier ::
|
@type modifier ::
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Utils.Graph do
|
defmodule Livebook.Utils.Graph do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
@typedoc """
|
@typedoc """
|
||||||
A bottom-up graph representation encoded as a map of child-to-parent
|
A bottom-up graph representation encoded as a map of child-to-parent
|
||||||
entries.
|
entries.
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Utils.HTTP do
|
defmodule Livebook.Utils.HTTP do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
@type status :: non_neg_integer()
|
@type status :: non_neg_integer()
|
||||||
@type headers :: list(header())
|
@type headers :: list(header())
|
||||||
@type header :: {String.t(), String.t()}
|
@type header :: {String.t(), String.t()}
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Utils.Time do
|
defmodule Livebook.Utils.Time do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# A simplified version of https://gist.github.com/tlemens/88e9b08f62150ba6082f478a4a03ac52
|
# A simplified version of https://gist.github.com/tlemens/88e9b08f62150ba6082f478a4a03ac52
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule Livebook.Utils.UniqueTask.Task do
|
defmodule Livebook.Utils.UniqueTask.Task do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
use GenServer, restart: :temporary
|
use GenServer, restart: :temporary
|
||||||
|
|
||||||
@registry Livebook.Utils.UniqueTask.Registry
|
@registry Livebook.Utils.UniqueTask.Registry
|
||||||
|
@ -22,8 +20,6 @@ defmodule Livebook.Utils.UniqueTask.Task do
|
||||||
end
|
end
|
||||||
|
|
||||||
defmodule Livebook.Utils.UniqueTask do
|
defmodule Livebook.Utils.UniqueTask do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
use Supervisor
|
use Supervisor
|
||||||
|
|
||||||
@registry Livebook.Utils.UniqueTask.Registry
|
@registry Livebook.Utils.UniqueTask.Registry
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule LivebookCLI do
|
defmodule LivebookCLI do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
def usage() do
|
def usage() do
|
||||||
"""
|
"""
|
||||||
Usage: livebook [command] [options]
|
Usage: livebook [command] [options]
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule LivebookCLI.Server do
|
defmodule LivebookCLI.Server do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
@behaviour LivebookCLI.Task
|
@behaviour LivebookCLI.Task
|
||||||
|
|
||||||
@external_resource "README.md"
|
@external_resource "README.md"
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule LivebookCLI.Task do
|
defmodule LivebookCLI.Task do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Returns a description of the task usage.
|
Returns a description of the task usage.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule LivebookWeb do
|
defmodule LivebookWeb do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
def static_paths, do: ~w(assets images favicon.svg favicon.png robots.txt)
|
def static_paths, do: ~w(assets images favicon.svg favicon.png robots.txt)
|
||||||
|
|
||||||
def controller do
|
def controller do
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
defmodule LivebookWeb.NotFoundError do
|
defmodule LivebookWeb.NotFoundError do
|
||||||
@moduledoc false
|
|
||||||
defexception [:message, plug_status: 404]
|
defexception [:message, plug_status: 404]
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule LivebookWeb.Helpers.ANSI do
|
defmodule LivebookWeb.Helpers.ANSI do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Takes a string with ANSI escape codes and build a HTML safe string
|
Takes a string with ANSI escape codes and build a HTML safe string
|
||||||
with `span` tags having classes corresponding to the escape codes.
|
with `span` tags having classes corresponding to the escape codes.
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
defmodule LivebookWeb.FileSystemWriter do
|
defmodule LivebookWeb.FileSystemWriter do
|
||||||
@moduledoc false
|
|
||||||
|
|
||||||
# Custom writer for live uploads, uploading directly using the
|
# Custom writer for live uploads, uploading directly using the
|
||||||
# `Livebook.FileSystem` abstraction.
|
# `Livebook.FileSystem` abstraction.
|
||||||
#
|
#
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue