Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

![Arke](https://github.com/arkemishub/arke/assets/81776297/7a04d11b-5cd0-4349-8621-d19cf0274585)

## Installation
## Documentation

In depth documentation can be found at [https://hexdocs.pm/arke](https://hexdocs.pm/arke), while a more generic can be found [here](https://docs.arkehub.com/docs)

If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `arke` to your list of dependencies in `mix.exs`:
## Installation
The package can be installed by adding `arke` to your list of dependencies in `mix.exs`:

```elixir
def deps do
Expand All @@ -15,7 +17,20 @@ def deps do
end
```

Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/arke](https://hexdocs.pm/arke).

Also add in our project the configuration below based on your persistence. In this case we use `arke_postgres`
```
config :arke,
persistence: %{
arke_postgres: %{
init: &ArkePostgres.init/0,
create: &ArkePostgres.create/2,
update: &ArkePostgres.update/2,
delete: &ArkePostgres.delete/2,
execute_query: &ArkePostgres.Query.execute/2,
create_project: &ArkePostgres.create_project/1,
delete_project: &ArkePostgres.delete_project/1,
repo: ArkePostgres.Repo,
}
}
```
This configuration is used to apply all the CRUD operations in the `Arke.QueryManager` module
1 change: 1 addition & 0 deletions lib/arke.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

defmodule Arke do
@moduledoc false
alias Arke.Core.Unit
alias Arke.Boundary.{ArkeManager, GroupManager, ParameterManager}
alias Arke.System.BaseParameter
Expand Down
7 changes: 4 additions & 3 deletions lib/arke/boundary/arke_manager.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
# limitations under the License.

defmodule Arke.Boundary.ArkeManager do
@moduledoc """
This module manage the gen servers for the element specified in `Arke.Core.Arke`
"""
@moduledoc false &&
"""
It extends `Arke.Boundary.UnitManager` by providing more functions specific to the Arkes.
"""

alias Arke.Utils.ErrorGenerator, as: Error
use Arke.Boundary.UnitManager
Expand Down
6 changes: 5 additions & 1 deletion lib/arke/boundary/group_manager.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
# limitations under the License.

defmodule Arke.Boundary.GroupManager do
@moduledoc false
@moduledoc false &&
"""
It extends `Arke.Boundary.UnitManager` by providing more functions specific to the Groups.
"""

use Arke.Boundary.UnitManager
alias Arke.Utils.ErrorGenerator, as: Error

Expand Down
7 changes: 4 additions & 3 deletions lib/arke/boundary/parameter_manager.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
# limitations under the License.

defmodule Arke.Boundary.ParameterManager do
@moduledoc false
@moduledoc false &&
"""
It extends `Arke.Boundary.UnitManager` by providing more functions specific to the Parameters.
"""
use Arke.Boundary.UnitManager

manager_id(:parameter)
# set_registry_name(:parameter_registry)
# set_supervisor_name(:parameter_supervisor)


end
4 changes: 4 additions & 0 deletions lib/arke/boundary/unit_manager.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
# limitations under the License.

defmodule Arke.Boundary.UnitManager do
@moduledoc false &&"""
This module handle all the managers providing functions to create/delete/edit such managers.
The managers stores the struct of a Unit. Such struct is used in the validation process.
"""
defmacro __using__(_) do
quote do
use GenServer
Expand Down
5 changes: 2 additions & 3 deletions lib/arke/core/arke.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@
# limitations under the License.

defmodule Arke.Core.Arke do
@moduledoc """
Defines the skeleton of an Arke by defining its characteristics and the various parameters of which it is composed
@moduledoc false && """
This module is used as entrypoint for every Arke created which does not have a module associated
"""
defstruct [:id, :label, :active, :type, :parameters]

use Arke.System
alias Arke.Core.Parameter
alias Arke.Boundary.ArkeManager

arke id: :arke do
Expand Down
12 changes: 6 additions & 6 deletions lib/arke/core/link.ex
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ defmodule Arke.Core.Link do
def on_create(
_,
%{
data: %{type: type, parent_id: parent_id, child_id: child_id},
metadata: %{project: project} = metadata
data: %{type: _type, parent_id: _parent_id, child_id: _child_id},
metadata: %{project: _project} = _metadata
} = unit
) do
{:ok, unit}
Expand All @@ -83,7 +83,7 @@ defmodule Arke.Core.Link do
_,
%{
data: %{type: "parameter", parent_id: parent_id, child_id: child_id},
metadata: %{project: project} = metadata
metadata: %{project: project} = _metadata
} = unit
) do
ArkeManager.remove_link(
Expand All @@ -100,7 +100,7 @@ defmodule Arke.Core.Link do
_,
%{
data: %{type: "group", parent_id: parent_id, child_id: child_id},
metadata: %{project: project} = metadata
metadata: %{project: project} = _metadata
} = unit
) do
GroupManager.remove_link(
Expand All @@ -116,8 +116,8 @@ defmodule Arke.Core.Link do
def on_delete(
_,
%{
data: %{type: type, parent_id: parent_id, child_id: child_id},
metadata: %{project: project} = metadata
data: %{type: _type, parent_id: _parent_id, child_id: _child_id},
metadata: %{project: _project} = _metadata
} = unit
) do
{:ok, unit}
Expand Down
Loading