diff --git a/flake.nix b/flake.nix index 2ff2a26..8217855 100644 --- a/flake.nix +++ b/flake.nix @@ -41,6 +41,23 @@ elixir --version ''; }; + packages = { + default = pkgs.callPackage ./nix/package.nix { + src = ./server; + }; + systant = pkgs.callPackage ./nix/package.nix { + src = ./server; + }; + }; + + apps = { + default = { + type = "app"; + program = "${self.packages.${system}.default}/bin/systant"; + }; + }; } - ); + ) // { + nixosModules.default = import ./nix/nixos-module.nix; + }; } diff --git a/nix/package.nix b/nix/package.nix index e028e18..dadc9a3 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -1,18 +1,14 @@ { lib, beamPackages, - fetchgit, + src, }: beamPackages.mixRelease rec { pname = "systant"; version = "0.1.0"; - src = fetchgit { - url = "https://git.ryanpandya.com/ryan/systant.git"; - rev = "54f8d23945bcea17127631a81f8ac318bf7047a6"; - sha256 = "sha256-1cRfSoH+JdO4a7q4hRZSkoDMk2wMCYRIyCIN56FSUgg="; - }; + inherit src; # Mix dependencies will be automatically fetched and cached by Nix mixFodDeps = beamPackages.fetchMixDeps { diff --git a/.envrc b/server/.envrc similarity index 100% rename from .envrc rename to server/.envrc diff --git a/.formatter.exs b/server/.formatter.exs similarity index 100% rename from .formatter.exs rename to server/.formatter.exs diff --git a/server/_build/dev/lib/gen_state_machine/.mix/compile.elixir b/server/_build/dev/lib/gen_state_machine/.mix/compile.elixir new file mode 100644 index 0000000..67d179e Binary files /dev/null and b/server/_build/dev/lib/gen_state_machine/.mix/compile.elixir differ diff --git a/server/_build/dev/lib/gen_state_machine/.mix/compile.elixir_scm b/server/_build/dev/lib/gen_state_machine/.mix/compile.elixir_scm new file mode 100644 index 0000000..c82d886 Binary files /dev/null and b/server/_build/dev/lib/gen_state_machine/.mix/compile.elixir_scm differ diff --git a/server/_build/dev/lib/gen_state_machine/.mix/compile.fetch b/server/_build/dev/lib/gen_state_machine/.mix/compile.fetch new file mode 100644 index 0000000..e69de29 diff --git a/server/_build/dev/lib/gen_state_machine/ebin/Elixir.GenStateMachine.Application.beam b/server/_build/dev/lib/gen_state_machine/ebin/Elixir.GenStateMachine.Application.beam new file mode 100644 index 0000000..70c1edb Binary files /dev/null and b/server/_build/dev/lib/gen_state_machine/ebin/Elixir.GenStateMachine.Application.beam differ diff --git a/server/_build/dev/lib/gen_state_machine/ebin/Elixir.GenStateMachine.Translator.beam b/server/_build/dev/lib/gen_state_machine/ebin/Elixir.GenStateMachine.Translator.beam new file mode 100644 index 0000000..7603687 Binary files /dev/null and b/server/_build/dev/lib/gen_state_machine/ebin/Elixir.GenStateMachine.Translator.beam differ diff --git a/server/_build/dev/lib/gen_state_machine/ebin/Elixir.GenStateMachine.beam b/server/_build/dev/lib/gen_state_machine/ebin/Elixir.GenStateMachine.beam new file mode 100644 index 0000000..0f65ed3 Binary files /dev/null and b/server/_build/dev/lib/gen_state_machine/ebin/Elixir.GenStateMachine.beam differ diff --git a/server/_build/dev/lib/gen_state_machine/ebin/gen_state_machine.app b/server/_build/dev/lib/gen_state_machine/ebin/gen_state_machine.app new file mode 100644 index 0000000..67a75b0 --- /dev/null +++ b/server/_build/dev/lib/gen_state_machine/ebin/gen_state_machine.app @@ -0,0 +1,10 @@ +{application,gen_state_machine, + [{modules,['Elixir.GenStateMachine', + 'Elixir.GenStateMachine.Application', + 'Elixir.GenStateMachine.Translator']}, + {optional_applications,[]}, + {applications,[kernel,stdlib,elixir,logger]}, + {description,"An Elixir wrapper for gen_statem."}, + {registered,[]}, + {vsn,"3.0.0"}, + {mod,{'Elixir.GenStateMachine.Application',[]}}]}. diff --git a/server/_build/dev/lib/jason/.mix/compile.elixir b/server/_build/dev/lib/jason/.mix/compile.elixir new file mode 100644 index 0000000..ced1753 Binary files /dev/null and b/server/_build/dev/lib/jason/.mix/compile.elixir differ diff --git a/server/_build/dev/lib/jason/.mix/compile.elixir_scm b/server/_build/dev/lib/jason/.mix/compile.elixir_scm new file mode 100644 index 0000000..c82d886 Binary files /dev/null and b/server/_build/dev/lib/jason/.mix/compile.elixir_scm differ diff --git a/server/_build/dev/lib/jason/.mix/compile.fetch b/server/_build/dev/lib/jason/.mix/compile.fetch new file mode 100644 index 0000000..e69de29 diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Enumerable.Jason.OrderedObject.beam b/server/_build/dev/lib/jason/ebin/Elixir.Enumerable.Jason.OrderedObject.beam new file mode 100644 index 0000000..62fbe22 Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Enumerable.Jason.OrderedObject.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Codegen.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Codegen.beam new file mode 100644 index 0000000..3ef40f5 Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Codegen.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.DecodeError.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.DecodeError.beam new file mode 100644 index 0000000..54dd2b3 Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.DecodeError.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Decoder.Unescape.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Decoder.Unescape.beam new file mode 100644 index 0000000..41683de Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Decoder.Unescape.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Decoder.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Decoder.beam new file mode 100644 index 0000000..82dc37c Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Decoder.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encode.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encode.beam new file mode 100644 index 0000000..223984e Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encode.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.EncodeError.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.EncodeError.beam new file mode 100644 index 0000000..0708d7c Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.EncodeError.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Any.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Any.beam new file mode 100644 index 0000000..a4d18cd Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Any.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Atom.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Atom.beam new file mode 100644 index 0000000..f46de61 Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Atom.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.BitString.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.BitString.beam new file mode 100644 index 0000000..0df9a1d Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.BitString.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Date.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Date.beam new file mode 100644 index 0000000..3eb3932 Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Date.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.DateTime.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.DateTime.beam new file mode 100644 index 0000000..6cfafc6 Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.DateTime.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Float.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Float.beam new file mode 100644 index 0000000..53b4f12 Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Float.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Integer.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Integer.beam new file mode 100644 index 0000000..0a247c5 Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Integer.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Jason.Fragment.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Jason.Fragment.beam new file mode 100644 index 0000000..150d116 Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Jason.Fragment.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Jason.OrderedObject.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Jason.OrderedObject.beam new file mode 100644 index 0000000..9b658a5 Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Jason.OrderedObject.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.List.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.List.beam new file mode 100644 index 0000000..38cea52 Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.List.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Map.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Map.beam new file mode 100644 index 0000000..d8d718c Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Map.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.NaiveDateTime.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.NaiveDateTime.beam new file mode 100644 index 0000000..41c0caf Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.NaiveDateTime.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Time.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Time.beam new file mode 100644 index 0000000..faade53 Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.Time.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.beam new file mode 100644 index 0000000..382ebdf Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Encoder.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Formatter.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Formatter.beam new file mode 100644 index 0000000..372c5de Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Formatter.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Fragment.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Fragment.beam new file mode 100644 index 0000000..1f6eb1b Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Fragment.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Helpers.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Helpers.beam new file mode 100644 index 0000000..2e3a3bb Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Helpers.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.OrderedObject.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.OrderedObject.beam new file mode 100644 index 0000000..40bc439 Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.OrderedObject.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.Sigil.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Sigil.beam new file mode 100644 index 0000000..d3467b1 Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.Sigil.beam differ diff --git a/server/_build/dev/lib/jason/ebin/Elixir.Jason.beam b/server/_build/dev/lib/jason/ebin/Elixir.Jason.beam new file mode 100644 index 0000000..9f3f7f1 Binary files /dev/null and b/server/_build/dev/lib/jason/ebin/Elixir.Jason.beam differ diff --git a/server/_build/dev/lib/jason/ebin/jason.app b/server/_build/dev/lib/jason/ebin/jason.app new file mode 100644 index 0000000..291dbed --- /dev/null +++ b/server/_build/dev/lib/jason/ebin/jason.app @@ -0,0 +1,26 @@ +{application,jason, + [{modules,['Elixir.Enumerable.Jason.OrderedObject', + 'Elixir.Jason','Elixir.Jason.Codegen', + 'Elixir.Jason.DecodeError','Elixir.Jason.Decoder', + 'Elixir.Jason.Decoder.Unescape','Elixir.Jason.Encode', + 'Elixir.Jason.EncodeError','Elixir.Jason.Encoder', + 'Elixir.Jason.Encoder.Any', + 'Elixir.Jason.Encoder.Atom', + 'Elixir.Jason.Encoder.BitString', + 'Elixir.Jason.Encoder.Date', + 'Elixir.Jason.Encoder.DateTime', + 'Elixir.Jason.Encoder.Float', + 'Elixir.Jason.Encoder.Integer', + 'Elixir.Jason.Encoder.Jason.Fragment', + 'Elixir.Jason.Encoder.Jason.OrderedObject', + 'Elixir.Jason.Encoder.List', + 'Elixir.Jason.Encoder.Map', + 'Elixir.Jason.Encoder.NaiveDateTime', + 'Elixir.Jason.Encoder.Time','Elixir.Jason.Formatter', + 'Elixir.Jason.Fragment','Elixir.Jason.Helpers', + 'Elixir.Jason.OrderedObject','Elixir.Jason.Sigil']}, + {optional_applications,[decimal]}, + {applications,[kernel,stdlib,elixir,decimal]}, + {description,"A blazing fast JSON parser and generator in pure Elixir.\n"}, + {registered,[]}, + {vsn,"1.4.4"}]}. diff --git a/server/_build/dev/lib/systant/.mix/compile.app_cache b/server/_build/dev/lib/systant/.mix/compile.app_cache new file mode 100644 index 0000000..5e5ae10 Binary files /dev/null and b/server/_build/dev/lib/systant/.mix/compile.app_cache differ diff --git a/server/_build/dev/lib/systant/.mix/compile.elixir b/server/_build/dev/lib/systant/.mix/compile.elixir new file mode 100644 index 0000000..e7b1ebf Binary files /dev/null and b/server/_build/dev/lib/systant/.mix/compile.elixir differ diff --git a/server/_build/dev/lib/systant/.mix/compile.elixir_scm b/server/_build/dev/lib/systant/.mix/compile.elixir_scm new file mode 100644 index 0000000..94f1ebb Binary files /dev/null and b/server/_build/dev/lib/systant/.mix/compile.elixir_scm differ diff --git a/server/_build/dev/lib/systant/.mix/compile.lock b/server/_build/dev/lib/systant/.mix/compile.lock new file mode 100644 index 0000000..e69de29 diff --git a/server/_build/dev/lib/systant/.mix/compile.protocols b/server/_build/dev/lib/systant/.mix/compile.protocols new file mode 100644 index 0000000..9c57252 Binary files /dev/null and b/server/_build/dev/lib/systant/.mix/compile.protocols differ diff --git a/server/_build/dev/lib/systant/consolidated/Elixir.Collectable.beam b/server/_build/dev/lib/systant/consolidated/Elixir.Collectable.beam new file mode 100644 index 0000000..9574005 Binary files /dev/null and b/server/_build/dev/lib/systant/consolidated/Elixir.Collectable.beam differ diff --git a/server/_build/dev/lib/systant/consolidated/Elixir.Enumerable.beam b/server/_build/dev/lib/systant/consolidated/Elixir.Enumerable.beam new file mode 100644 index 0000000..21ef91f Binary files /dev/null and b/server/_build/dev/lib/systant/consolidated/Elixir.Enumerable.beam differ diff --git a/server/_build/dev/lib/systant/consolidated/Elixir.IEx.Info.beam b/server/_build/dev/lib/systant/consolidated/Elixir.IEx.Info.beam new file mode 100644 index 0000000..9586162 Binary files /dev/null and b/server/_build/dev/lib/systant/consolidated/Elixir.IEx.Info.beam differ diff --git a/server/_build/dev/lib/systant/consolidated/Elixir.Inspect.beam b/server/_build/dev/lib/systant/consolidated/Elixir.Inspect.beam new file mode 100644 index 0000000..4b98806 Binary files /dev/null and b/server/_build/dev/lib/systant/consolidated/Elixir.Inspect.beam differ diff --git a/server/_build/dev/lib/systant/consolidated/Elixir.JSON.Encoder.beam b/server/_build/dev/lib/systant/consolidated/Elixir.JSON.Encoder.beam new file mode 100644 index 0000000..ab8b471 Binary files /dev/null and b/server/_build/dev/lib/systant/consolidated/Elixir.JSON.Encoder.beam differ diff --git a/server/_build/dev/lib/systant/consolidated/Elixir.Jason.Encoder.beam b/server/_build/dev/lib/systant/consolidated/Elixir.Jason.Encoder.beam new file mode 100644 index 0000000..683efdf Binary files /dev/null and b/server/_build/dev/lib/systant/consolidated/Elixir.Jason.Encoder.beam differ diff --git a/server/_build/dev/lib/systant/consolidated/Elixir.List.Chars.beam b/server/_build/dev/lib/systant/consolidated/Elixir.List.Chars.beam new file mode 100644 index 0000000..276955f Binary files /dev/null and b/server/_build/dev/lib/systant/consolidated/Elixir.List.Chars.beam differ diff --git a/server/_build/dev/lib/systant/consolidated/Elixir.String.Chars.beam b/server/_build/dev/lib/systant/consolidated/Elixir.String.Chars.beam new file mode 100644 index 0000000..573c1ee Binary files /dev/null and b/server/_build/dev/lib/systant/consolidated/Elixir.String.Chars.beam differ diff --git a/server/_build/dev/lib/systant/consolidated/Elixir.Tortoise.Decodable.beam b/server/_build/dev/lib/systant/consolidated/Elixir.Tortoise.Decodable.beam new file mode 100644 index 0000000..1588545 Binary files /dev/null and b/server/_build/dev/lib/systant/consolidated/Elixir.Tortoise.Decodable.beam differ diff --git a/server/_build/dev/lib/systant/consolidated/Elixir.Tortoise.Encodable.beam b/server/_build/dev/lib/systant/consolidated/Elixir.Tortoise.Encodable.beam new file mode 100644 index 0000000..20557e2 Binary files /dev/null and b/server/_build/dev/lib/systant/consolidated/Elixir.Tortoise.Encodable.beam differ diff --git a/server/_build/dev/lib/systant/ebin/Elixir.Systant.Application.beam b/server/_build/dev/lib/systant/ebin/Elixir.Systant.Application.beam new file mode 100644 index 0000000..08335b9 Binary files /dev/null and b/server/_build/dev/lib/systant/ebin/Elixir.Systant.Application.beam differ diff --git a/server/_build/dev/lib/systant/ebin/Elixir.Systant.MqttClient.beam b/server/_build/dev/lib/systant/ebin/Elixir.Systant.MqttClient.beam new file mode 100644 index 0000000..1133a35 Binary files /dev/null and b/server/_build/dev/lib/systant/ebin/Elixir.Systant.MqttClient.beam differ diff --git a/server/_build/dev/lib/systant/ebin/Elixir.Systant.beam b/server/_build/dev/lib/systant/ebin/Elixir.Systant.beam new file mode 100644 index 0000000..9e86985 Binary files /dev/null and b/server/_build/dev/lib/systant/ebin/Elixir.Systant.beam differ diff --git a/server/_build/dev/lib/systant/ebin/systant.app b/server/_build/dev/lib/systant/ebin/systant.app new file mode 100644 index 0000000..805f602 --- /dev/null +++ b/server/_build/dev/lib/systant/ebin/systant.app @@ -0,0 +1,9 @@ +{application,systant, + [{modules,['Elixir.Systant','Elixir.Systant.Application', + 'Elixir.Systant.MqttClient']}, + {optional_applications,[]}, + {applications,[kernel,stdlib,elixir,logger,tortoise,jason]}, + {description,"systant"}, + {registered,[]}, + {vsn,"0.1.0"}, + {mod,{'Elixir.Systant.Application',[]}}]}. diff --git a/server/_build/dev/lib/tortoise/.mix/compile.elixir b/server/_build/dev/lib/tortoise/.mix/compile.elixir new file mode 100644 index 0000000..d0a30a4 Binary files /dev/null and b/server/_build/dev/lib/tortoise/.mix/compile.elixir differ diff --git a/server/_build/dev/lib/tortoise/.mix/compile.elixir_scm b/server/_build/dev/lib/tortoise/.mix/compile.elixir_scm new file mode 100644 index 0000000..c82d886 Binary files /dev/null and b/server/_build/dev/lib/tortoise/.mix/compile.elixir_scm differ diff --git a/server/_build/dev/lib/tortoise/.mix/compile.fetch b/server/_build/dev/lib/tortoise/.mix/compile.fetch new file mode 100644 index 0000000..e69de29 diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Collectable.Tortoise.Package.Subscribe.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Collectable.Tortoise.Package.Subscribe.beam new file mode 100644 index 0000000..37a3d02 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Collectable.Tortoise.Package.Subscribe.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Enumerable.Tortoise.Package.Subscribe.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Enumerable.Tortoise.Package.Subscribe.beam new file mode 100644 index 0000000..1746d9a Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Enumerable.Tortoise.Package.Subscribe.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.App.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.App.beam new file mode 100644 index 0000000..565ccaa Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.App.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.Backoff.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.Backoff.beam new file mode 100644 index 0000000..4e98b59 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.Backoff.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.Controller.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.Controller.beam new file mode 100644 index 0000000..1f1fd2d Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.Controller.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.Inflight.Track.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.Inflight.Track.beam new file mode 100644 index 0000000..7fdbd81 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.Inflight.Track.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.Inflight.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.Inflight.beam new file mode 100644 index 0000000..d009663 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.Inflight.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.Receiver.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.Receiver.beam new file mode 100644 index 0000000..f595bd4 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.Receiver.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.Supervisor.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.Supervisor.beam new file mode 100644 index 0000000..64a4740 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.Supervisor.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.beam new file mode 100644 index 0000000..55af009 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Connection.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Decodable.BitString.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Decodable.BitString.beam new file mode 100644 index 0000000..95b7bf5 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Decodable.BitString.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Decodable.List.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Decodable.List.beam new file mode 100644 index 0000000..d62c25a Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Decodable.List.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Decodable.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Decodable.beam new file mode 100644 index 0000000..4cc0a47 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Decodable.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Connack.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Connack.beam new file mode 100644 index 0000000..a64d12f Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Connack.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Connect.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Connect.beam new file mode 100644 index 0000000..4496367 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Connect.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Disconnect.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Disconnect.beam new file mode 100644 index 0000000..053a6a9 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Disconnect.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Pingreq.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Pingreq.beam new file mode 100644 index 0000000..d007ab9 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Pingreq.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Pingresp.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Pingresp.beam new file mode 100644 index 0000000..5db5fa4 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Pingresp.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Puback.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Puback.beam new file mode 100644 index 0000000..5afa7cb Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Puback.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Pubcomp.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Pubcomp.beam new file mode 100644 index 0000000..52ab9ab Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Pubcomp.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Publish.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Publish.beam new file mode 100644 index 0000000..c277872 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Publish.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Pubrec.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Pubrec.beam new file mode 100644 index 0000000..77bb659 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Pubrec.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Pubrel.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Pubrel.beam new file mode 100644 index 0000000..1bd7c2f Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Pubrel.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Suback.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Suback.beam new file mode 100644 index 0000000..32821cd Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Suback.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Subscribe.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Subscribe.beam new file mode 100644 index 0000000..4fb4cdb Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Subscribe.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Unsuback.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Unsuback.beam new file mode 100644 index 0000000..118a1bd Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Unsuback.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Unsubscribe.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Unsubscribe.beam new file mode 100644 index 0000000..7ad86b5 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.Tortoise.Package.Unsubscribe.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.beam new file mode 100644 index 0000000..7138ec9 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Encodable.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Events.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Events.beam new file mode 100644 index 0000000..0963dea Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Events.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Handler.Default.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Handler.Default.beam new file mode 100644 index 0000000..2be5a2f Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Handler.Default.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Handler.Logger.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Handler.Logger.beam new file mode 100644 index 0000000..4636f60 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Handler.Logger.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Handler.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Handler.beam new file mode 100644 index 0000000..c787690 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Handler.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Connack.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Connack.beam new file mode 100644 index 0000000..3710692 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Connack.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Connect.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Connect.beam new file mode 100644 index 0000000..3bdac82 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Connect.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Disconnect.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Disconnect.beam new file mode 100644 index 0000000..7c909e4 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Disconnect.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Meta.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Meta.beam new file mode 100644 index 0000000..8f552da Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Meta.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Pingreq.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Pingreq.beam new file mode 100644 index 0000000..38e7cc2 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Pingreq.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Pingresp.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Pingresp.beam new file mode 100644 index 0000000..eac87bf Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Pingresp.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Puback.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Puback.beam new file mode 100644 index 0000000..06bda41 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Puback.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Pubcomp.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Pubcomp.beam new file mode 100644 index 0000000..480687c Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Pubcomp.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Publish.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Publish.beam new file mode 100644 index 0000000..97e2582 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Publish.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Pubrec.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Pubrec.beam new file mode 100644 index 0000000..3b25656 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Pubrec.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Pubrel.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Pubrel.beam new file mode 100644 index 0000000..f2d21d2 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Pubrel.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Suback.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Suback.beam new file mode 100644 index 0000000..e0370f4 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Suback.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Subscribe.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Subscribe.beam new file mode 100644 index 0000000..c9f2d84 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Subscribe.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Unsuback.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Unsuback.beam new file mode 100644 index 0000000..080beb9 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Unsuback.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Unsubscribe.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Unsubscribe.beam new file mode 100644 index 0000000..a15d7b5 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.Unsubscribe.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.beam new file mode 100644 index 0000000..f4f2b40 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Package.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Pipe.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Pipe.beam new file mode 100644 index 0000000..f3baf18 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Pipe.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Registry.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Registry.beam new file mode 100644 index 0000000..ccb8d73 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Registry.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Supervisor.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Supervisor.beam new file mode 100644 index 0000000..7ea6323 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Supervisor.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Transport.SSL.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Transport.SSL.beam new file mode 100644 index 0000000..ef1310d Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Transport.SSL.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Transport.Tcp.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Transport.Tcp.beam new file mode 100644 index 0000000..21492c5 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Transport.Tcp.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Transport.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Transport.beam new file mode 100644 index 0000000..304af09 Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.Transport.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.beam b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.beam new file mode 100644 index 0000000..d51bfef Binary files /dev/null and b/server/_build/dev/lib/tortoise/ebin/Elixir.Tortoise.beam differ diff --git a/server/_build/dev/lib/tortoise/ebin/tortoise.app b/server/_build/dev/lib/tortoise/ebin/tortoise.app new file mode 100644 index 0000000..675f410 --- /dev/null +++ b/server/_build/dev/lib/tortoise/ebin/tortoise.app @@ -0,0 +1,60 @@ +{application,tortoise, + [{modules,['Elixir.Collectable.Tortoise.Package.Subscribe', + 'Elixir.Enumerable.Tortoise.Package.Subscribe', + 'Elixir.Tortoise','Elixir.Tortoise.App', + 'Elixir.Tortoise.Connection', + 'Elixir.Tortoise.Connection.Backoff', + 'Elixir.Tortoise.Connection.Controller', + 'Elixir.Tortoise.Connection.Inflight', + 'Elixir.Tortoise.Connection.Inflight.Track', + 'Elixir.Tortoise.Connection.Receiver', + 'Elixir.Tortoise.Connection.Supervisor', + 'Elixir.Tortoise.Decodable', + 'Elixir.Tortoise.Decodable.BitString', + 'Elixir.Tortoise.Decodable.List', + 'Elixir.Tortoise.Encodable', + 'Elixir.Tortoise.Encodable.Tortoise.Package.Connack', + 'Elixir.Tortoise.Encodable.Tortoise.Package.Connect', + 'Elixir.Tortoise.Encodable.Tortoise.Package.Disconnect', + 'Elixir.Tortoise.Encodable.Tortoise.Package.Pingreq', + 'Elixir.Tortoise.Encodable.Tortoise.Package.Pingresp', + 'Elixir.Tortoise.Encodable.Tortoise.Package.Puback', + 'Elixir.Tortoise.Encodable.Tortoise.Package.Pubcomp', + 'Elixir.Tortoise.Encodable.Tortoise.Package.Publish', + 'Elixir.Tortoise.Encodable.Tortoise.Package.Pubrec', + 'Elixir.Tortoise.Encodable.Tortoise.Package.Pubrel', + 'Elixir.Tortoise.Encodable.Tortoise.Package.Suback', + 'Elixir.Tortoise.Encodable.Tortoise.Package.Subscribe', + 'Elixir.Tortoise.Encodable.Tortoise.Package.Unsuback', + 'Elixir.Tortoise.Encodable.Tortoise.Package.Unsubscribe', + 'Elixir.Tortoise.Events','Elixir.Tortoise.Handler', + 'Elixir.Tortoise.Handler.Default', + 'Elixir.Tortoise.Handler.Logger', + 'Elixir.Tortoise.Package', + 'Elixir.Tortoise.Package.Connack', + 'Elixir.Tortoise.Package.Connect', + 'Elixir.Tortoise.Package.Disconnect', + 'Elixir.Tortoise.Package.Meta', + 'Elixir.Tortoise.Package.Pingreq', + 'Elixir.Tortoise.Package.Pingresp', + 'Elixir.Tortoise.Package.Puback', + 'Elixir.Tortoise.Package.Pubcomp', + 'Elixir.Tortoise.Package.Publish', + 'Elixir.Tortoise.Package.Pubrec', + 'Elixir.Tortoise.Package.Pubrel', + 'Elixir.Tortoise.Package.Suback', + 'Elixir.Tortoise.Package.Subscribe', + 'Elixir.Tortoise.Package.Unsuback', + 'Elixir.Tortoise.Package.Unsubscribe', + 'Elixir.Tortoise.Pipe','Elixir.Tortoise.Registry', + 'Elixir.Tortoise.Supervisor', + 'Elixir.Tortoise.Transport', + 'Elixir.Tortoise.Transport.SSL', + 'Elixir.Tortoise.Transport.Tcp']}, + {optional_applications,[]}, + {applications,[kernel,stdlib,elixir,logger,ssl, + gen_state_machine]}, + {description,"A MQTT client for Elixir.\n"}, + {registered,[]}, + {vsn,"0.9.9"}, + {mod,{'Elixir.Tortoise.App',[]}}]}. diff --git a/config/config.exs b/server/config/config.exs similarity index 100% rename from config/config.exs rename to server/config/config.exs diff --git a/config/runtime.exs b/server/config/runtime.exs similarity index 100% rename from config/runtime.exs rename to server/config/runtime.exs diff --git a/server/deps/gen_state_machine/.hex b/server/deps/gen_state_machine/.hex new file mode 100644 index 0000000..cca8ae3 Binary files /dev/null and b/server/deps/gen_state_machine/.hex differ diff --git a/server/deps/gen_state_machine/LICENSE b/server/deps/gen_state_machine/LICENSE new file mode 100644 index 0000000..48d4942 --- /dev/null +++ b/server/deps/gen_state_machine/LICENSE @@ -0,0 +1,201 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, +and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by +the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all +other entities that control, are controlled by, or are under common +control with that entity. For the purposes of this definition, +"control" means (i) the power, direct or indirect, to cause the +direction or management of such entity, whether by contract or +otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity +exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation +source, and configuration files. + +"Object" form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but +not limited to compiled object code, generated documentation, +and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or +Object form, made available under the License, as indicated by a +copyright notice that is included in or attached to the work +(an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object +form, that is based on (or derived from) the Work and for which the +editorial revisions, annotations, elaborations, or other modifications +represent, as a whole, an original work of authorship. For the purposes +of this License, Derivative Works shall not include works that remain +separable from, or merely link (or bind by name) to the interfaces of, +the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including +the original version of the Work and any modifications or additions +to that Work or Derivative Works thereof, that is intentionally +submitted to Licensor for inclusion in the Work by the copyright owner +or by an individual or Legal Entity authorized to submit on behalf of +the copyright owner. For the purposes of this definition, "submitted" +means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, +and issue tracking systems that are managed by, or on behalf of, the +Licensor for the purpose of discussing and improving the Work, but +excluding communication that is conspicuously marked or otherwise +designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity +on behalf of whom a Contribution has been received by Licensor and +subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the +Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +(except as stated in this section) patent license to make, have made, +use, offer to sell, sell, import, and otherwise transfer the Work, +where such license applies only to those patent claims licensable +by such Contributor that are necessarily infringed by their +Contribution(s) alone or by combination of their Contribution(s) +with the Work to which such Contribution(s) was submitted. If You +institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work +or a Contribution incorporated within the Work constitutes direct +or contributory patent infringement, then any patent licenses +granted to You under this License for that Work shall terminate +as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the +Work or Derivative Works thereof in any medium, with or without +modifications, and in Source or Object form, provided that You +meet the following conditions: + +(a) You must give any other recipients of the Work or +Derivative Works a copy of this License; and + +(b) You must cause any modified files to carry prominent notices +stating that You changed the files; and + +(c) You must retain, in the Source form of any Derivative Works +that You distribute, all copyright, patent, trademark, and +attribution notices from the Source form of the Work, +excluding those notices that do not pertain to any part of +the Derivative Works; and + +(d) If the Work includes a "NOTICE" text file as part of its +distribution, then any Derivative Works that You distribute must +include a readable copy of the attribution notices contained +within such NOTICE file, excluding those notices that do not +pertain to any part of the Derivative Works, in at least one +of the following places: within a NOTICE text file distributed +as part of the Derivative Works; within the Source form or +documentation, if provided along with the Derivative Works; or, +within a display generated by the Derivative Works, if and +wherever such third-party notices normally appear. The contents +of the NOTICE file are for informational purposes only and +do not modify the License. You may add Your own attribution +notices within Derivative Works that You distribute, alongside +or as an addendum to the NOTICE text from the Work, provided +that such additional attribution notices cannot be construed +as modifying the License. + +You may add Your own copyright statement to Your modifications and +may provide additional or different license terms and conditions +for use, reproduction, or distribution of Your modifications, or +for any such Derivative Works as a whole, provided Your use, +reproduction, and distribution of the Work otherwise complies with +the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, +any Contribution intentionally submitted for inclusion in the Work +by You to the Licensor shall be under the terms and conditions of +this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify +the terms of any separate license agreement you may have executed +with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, +except as required for reasonable and customary use in describing the +origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or +agreed to in writing, Licensor provides the Work (and each +Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied, including, without limitation, any warranties or conditions +of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +PARTICULAR PURPOSE. You are solely responsible for determining the +appropriateness of using or redistributing the Work and assume any +risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, +whether in tort (including negligence), contract, or otherwise, +unless required by applicable law (such as deliberate and grossly +negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, +incidental, or consequential damages of any character arising as a +result of this License or out of the use or inability to use the +Work (including but not limited to damages for loss of goodwill, +work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses), even if such Contributor +has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing +the Work or Derivative Works thereof, You may choose to offer, +and charge a fee for, acceptance of support, warranty, indemnity, +or other liability obligations and/or rights consistent with this +License. However, in accepting such obligations, You may act only +on Your own behalf and on Your sole responsibility, not on behalf +of any other Contributor, and only if You agree to indemnify, +defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason +of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following +boilerplate notice, with the fields enclosed by brackets "{}" +replaced with your own identifying information. (Don't include +the brackets!) The text should be enclosed in the appropriate +comment syntax for the file format. We also recommend that a +file or class name and description of purpose be included on the +same "printed page" as the copyright notice for easier +identification within third-party archives. + +Copyright {yyyy} {name of copyright owner} + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/server/deps/gen_state_machine/README.md b/server/deps/gen_state_machine/README.md new file mode 100644 index 0000000..487676a --- /dev/null +++ b/server/deps/gen_state_machine/README.md @@ -0,0 +1,49 @@ +[![Elixir CI](https://github.com/ericentin/gen_state_machine/workflows/Elixir%20CI/badge.svg)](https://github.com/ericentin/gen_state_machine/actions?query=workflow%3A%22Elixir+CI%22) + +# GenStateMachine + +An idiomatic Elixir wrapper for `gen_statem` in OTP 19 (and above). + +**Full documentation is available [here](https://hexdocs.pm/gen_state_machine).** + +**You can find the package on Hex [here](https://hex.pm/packages/gen_state_machine).** + +One important difference between `gen_statem` and this wrapper is that you +declare your callback mode as part of `use GenStateMachine` in this wrapper, +rather than returning it from `callback_mode/0` on OTP 19.1 and up, or your +`init/1` and `code_change/4` on versions of OTP prior to 19.1. In versions of +OTP prior to 19.1, you can still, however, switch callback modes in +`code_change/4` by returning a callback mode. + +Other than that (and the usual automatically-defined default callbacks as a +result of `use`-ing `GenStateMachine`), this wrapper does not make any +functional alterations. + +This wrapper also provides a OTP error translator for `Logger`, which is +automatically added when the `:gen_state_machine` application is started. +Optionally, you may add `:gen_state_machine` to `:included_applications` rather +than `:applications` as indicated below if you do not want the translator to be +added to `Logger`. + +## Installation + + 1. Add `gen_state_machine` to your list of dependencies in `mix.exs`: + + ```elixir + def deps do + [{:gen_state_machine, "~> 2.0"}] + end + ``` + + 2. Ensure `gen_state_machine` is added to your applications: + + ```elixir + def application do + [applications: [:gen_state_machine]] + end + ``` + +## Special Thanks + +I would like to give special thanks to @fishcakez and @michalmuskala, who both +provided invaluable feedback on this library! diff --git a/server/deps/gen_state_machine/hex_metadata.config b/server/deps/gen_state_machine/hex_metadata.config new file mode 100644 index 0000000..35d340f --- /dev/null +++ b/server/deps/gen_state_machine/hex_metadata.config @@ -0,0 +1,15 @@ +{<<"app">>,<<"gen_state_machine">>}. +{<<"build_tools">>,[<<"mix">>]}. +{<<"description">>,<<"An Elixir wrapper for gen_statem.">>}. +{<<"elixir">>,<<"~> 1.5">>}. +{<<"files">>, + [<<"lib">>,<<"lib/gen_state_machine">>, + <<"lib/gen_state_machine/application.ex">>, + <<"lib/gen_state_machine/translator.ex">>,<<"lib/gen_state_machine.ex">>, + <<"mix.exs">>,<<"README.md">>,<<"LICENSE">>]}. +{<<"licenses">>,[<<"Apache 2.0">>]}. +{<<"links">>, + [{<<"GitHub">>,<<"https://github.com/ericentin/gen_state_machine">>}]}. +{<<"name">>,<<"gen_state_machine">>}. +{<<"requirements">>,[]}. +{<<"version">>,<<"3.0.0">>}. diff --git a/server/deps/gen_state_machine/lib/gen_state_machine.ex b/server/deps/gen_state_machine/lib/gen_state_machine.ex new file mode 100644 index 0000000..9bcf0e1 --- /dev/null +++ b/server/deps/gen_state_machine/lib/gen_state_machine.ex @@ -0,0 +1,773 @@ +defmodule GenStateMachine do + @moduledoc """ + A behaviour module for implementing a state machine. + + The advantage of using this module is that it will have a standard set of + interface functions and include functionality for tracing and error reporting. + It will also fit into a supervision tree. + + ## Example + + The `GenStateMachine` behaviour abstracts the state machine. Developers are only + required to implement the callbacks and functionality they are interested in. + + Let's start with a code example and then explore the available callbacks. + Imagine we want a `GenStateMachine` that works like a switch, allowing us to + turn it on and off, as well as see how many times the switch has been turned + on: + + defmodule Switch do + use GenStateMachine + + # Callbacks + + def handle_event(:cast, :flip, :off, data) do + {:next_state, :on, data + 1} + end + + def handle_event(:cast, :flip, :on, data) do + {:next_state, :off, data} + end + + def handle_event({:call, from}, :get_count, state, data) do + {:next_state, state, data, [{:reply, from, data}]} + end + end + + # Start the server + {:ok, pid} = GenStateMachine.start_link(Switch, {:off, 0}) + + # This is the client + GenStateMachine.cast(pid, :flip) + #=> :ok + + GenStateMachine.call(pid, :get_count) + #=> 1 + + We start our `Switch` by calling `start_link/3`, passing the module with the + server implementation and its initial argument, a tuple where the first element + is the initial state and the second is the initial data. We can primarily + interact with the state machine by sending two types of messages. **call** + messages expect a reply from the server (and are therefore synchronous) while + **cast** messages do not. + + Every time you do a `call/3` or a `cast/2`, the message will be handled by + `handle_event/4`. + + We can also use the `:state_functions` callback mode instead of the default, + which is `:handle_event_function`: + + defmodule Switch do + use GenStateMachine, callback_mode: :state_functions + + def off(:cast, :flip, data) do + {:next_state, :on, data + 1} + end + def off({:call, from}, :get_count, data) do + {:keep_state_and_data, [{:reply, from, data}]} + end + + def on(:cast, :flip, data) do + {:next_state, :off, data} + end + def on({:call, from}, :get_count, data) do + {:keep_state_and_data, [{:reply, from, data}]} + end + end + + # Start the server + {:ok, pid} = GenStateMachine.start_link(Switch, {:off, 0}) + + # This is the client + GenStateMachine.cast(pid, :flip) + #=> :ok + + GenStateMachine.call(pid, :get_count) + #=> 1 + + Again, we start our `Switch` by calling `start_link/3`, passing the module + with the server implementation and its initial argument, and interacting with + it via **call** and **cast**. + + However, in `:state_functions` callback mode, every time you do a `call/3` or + a `cast/2`, the message will be handled by the `state_name/3` function which + is named the same as the current state. + + ## Callbacks + + In the default `:handle_event_function` callback mode, there are 4 callbacks + required to be implemented. By adding `use GenStateMachine` to your module, + Elixir will automatically define all 4 callbacks for you, leaving it up to you + to implement the ones you want to customize. + + In the `:state_functions` callback mode, there are 3 callbacks required to be + implemented. By adding `use GenStateMachine, callback_mode: :state_functions` + to your module, Elixir will automatically define all 3 callbacks for you, + leaving it up to you to implement the ones you want to customize, as well as + `state_name/3` functions named the same as the states you wish to support. + + It is important to note that the default implementation of the `code_change/4` + callback results in an `:undefined` error. This is because `code_change/4` is + related to the quite difficult topic of hot upgrades, and if you need it, you + should really be implementing it yourself. In normal use this callback will + not be invoked. + + ## State Enter Callbacks + + If you wish, you can register to receive callbacks when you enter a state by + adding `:state_enter` to your `callback_mode`: + + defmodule Switch do + use GenStateMachine, callback_mode: [:handle_event_function, :state_enter] + + def handle_event(:enter, _event, state, data) do + {:next_state, state, %{data | enters: data.enters + 1}} + end + + def handle_event(:cast, :flip, :off, data) do + {:next_state, :on, %{data | flips: data.flips + 1}} + end + + def handle_event(:cast, :flip, :on, data) do + {:next_state, :off, data} + end + + def handle_event({:call, from}, :get_count, _state, data) do + {:keep_state_and_data, [{:reply, from, data}]} + end + end + + # Start the server + {:ok, pid} = GenStateMachine.start_link(Switch, {:off, %{enters: 0, flips: 0}}) + + # This is the client + GenStateMachine.cast(pid, :flip) + GenStateMachine.cast(pid, :flip) + #=> :ok + + GenStateMachine.call(pid, :get_count) + #=> %{enters: 3, flips: 1} + + See the Erlang [documentation](https://erlang.org/doc/man/gen_statem.html#type-state_enter) + for more details. + + ## Name Registration + + Both `start_link/3` and `start/3` support registering the `GenStateMachine` + under a given name on start via the `:name` option. Registered names are also + automatically cleaned up on termination. The supported values are: + + * an atom - the `GenStateMachine` is registered locally with the given name + using `Process.register/2`. + + * `{:global, term}`- the `GenStateMachine` is registered globally with the + given term using the functions in the `:global` module. + + * `{:via, module, term}` - the `GenStateMachine` is registered with the given + mechanism and name. The `:via` option expects a module that exports + `register_name/2`, `unregister_name/1`, `whereis_name/1` and `send/2`. + One such example is the `:global` module which uses these functions + for keeping the list of names of processes and their associated pid's + that are available globally for a network of Erlang nodes. + + For example, we could start and register our Switch server locally as follows: + + # Start the server and register it locally with name MySwitch + {:ok, _} = GenStateMachine.start_link(Switch, {:off, 0}, name: MySwitch) + + # Now messages can be sent directly to MySwitch + GenStateMachine.call(MySwitch, :get_count) #=> 0 + + Once the server is started, the remaining functions in this module (`call/3`, + `cast/2`, and friends) will also accept an atom, or any `:global` or `:via` + tuples. In general, the following formats are supported: + + * a `pid` + * an `atom` if the server is locally registered + * `{atom, node}` if the server is locally registered at another node + * `{:global, term}` if the server is globally registered + * `{:via, module, name}` if the server is registered through an alternative + registry + + ## Client / Server APIs + + Although in the example above we have used `GenStateMachine.start_link/3` and + friends to directly start and communicate with the server, most of the + time we don't call the `GenStateMachine` functions directly. Instead, we wrap + the calls in new functions representing the public API of the server. + + Here is a better implementation of our Switch module: + + defmodule Switch do + use GenStateMachine + + # Client + + def start_link() do + GenStateMachine.start_link(Switch, {:off, 0}) + end + + def flip(pid) do + GenStateMachine.cast(pid, :flip) + end + + def get_count(pid) do + GenStateMachine.call(pid, :get_count) + end + + # Server (callbacks) + + def handle_event(:cast, :flip, :off, data) do + {:next_state, :on, data + 1} + end + + def handle_event(:cast, :flip, :on, data) do + {:next_state, :off, data} + end + + def handle_event({:call, from}, :get_count, state, data) do + {:next_state, state, data, [{:reply, from, data}]} + end + + def handle_event(event_type, event_content, state, data) do + # Call the default implementation from GenStateMachine + super(event_type, event_content, state, data) + end + end + + In practice, it is common to have both server and client functions in + the same module. If the server and/or client implementations are growing + complex, you may want to have them in different modules. + + ## Receiving custom messages + + The goal of a `GenStateMachine` is to abstract the "receive" loop for + developers, automatically handling system messages, support code change, + synchronous calls and more. Therefore, you should never call your own + "receive" inside the `GenStateMachine` callbacks as doing so will cause the + `GenStateMachine` to misbehave. If you want to receive custom messages, they + will be delivered to the usual handler for your callback mode with event_type + `:info`. + + ## Learn more + + If you wish to find out more about gen_statem, the documentation and links + in Erlang can provide extra insight. + + * [`:gen_statem` module documentation](http://erlang.org/doc/man/gen_statem.html) + * [gen_statem Behaviour – OTP Design Principles](http://erlang.org/doc/design_principles/statem.html) + """ + + @typedoc """ + The term representing the current state. + + In `:handle_event_function` callback mode, any term. + + In `:state_functions` callback mode, an atom. + """ + @type state :: state_name | term + + @typedoc """ + The atom representing the current state in `:state_functions` callback mode. + """ + @type state_name :: atom + + @typedoc """ + The persistent data (similar to a GenServer's `state`) for the GenStateMachine. + """ + @type data :: term + + @typedoc """ + The source of the current event. + + `{:call, from}` will be received as a result of a call. + + `:cast` will be received as a result of a cast. + + `:info` will be received as a result of any regular process messages received. + + `:timeout` or `{:timeout, name}` will be received as a result of a `:timeout` action. + + `:state_timeout` will be received as a result of a `:state_timeout` action. + + `:internal` will be received as a result of a `:next_event` action. + + See the Erlang + [documentation](https://erlang.org/doc/man/gen_statem.html#type-event_type) + for details. + """ + @type event_type :: :gen_statem.event_type() + + @typedoc """ + The callback mode for the GenStateMachine. + + See the Example section above for more info. + """ + @type callback_mode_result :: :gen_statem.callback_mode_result() + + @typedoc """ + The message content received as the result of an event. + """ + @type event_content :: term + + @typedoc """ + State transition actions. + + They may be invoked by returning them from a state function or init/1. + + If present in a list of actions, they are executed in order, and any that set + transition options (postpone, hibernate, and timeout) override any previously + provided options of the same type. + + If the state changes, the queue of incoming events is reset to start with the + oldest postponed. + + All events added as a result of a `:next_event` action are inserted in the + queue to be processed before all other events. An event of type `:internal` + should be used when you want to reliably distinguish an event inserted this + way from an external event. + + See the Erlang + [documentation](https://erlang.org/doc/man/gen_statem.html#type-action) + for the possible values. + """ + @type action :: :gen_statem.action() + + @typedoc """ + The return type of an event handler function. + + See the Erlang [documentation](https://erlang.org/doc/man/gen_statem.html#type-event_handler_result) + for a complete reference. + """ + @type event_handler_result(state) :: :gen_statem.event_handler_result(state) + + @typedoc """ + The return type of a state enter function. + + See the Erlang [documentation](https://erlang.org/doc/man/gen_statem.html#type-state_enter_result) + for a complete reference. + """ + @type state_enter_result(state) :: :gen_statem.state_enter_result(state) + + @typedoc """ + The return type when the server is started. + + See the Erlang [documentation](https://erlang.org/doc/man/gen_statem.html#type-start_ret) + for a complete reference. + """ + @type on_start :: :gen_statem.start_ret() + + @typedoc """ + The type of allowed server names. + + See the Erlang [documentation](https://erlang.org/doc/man/gen_statem.html#type-server_ref) + for a complete reference. + """ + @type server_ref :: :gen_statem.server_ref() + + @doc """ + Invoked when the server is started. `start_link/3` (or `start/3`) will + block until it returns. + + `args` is the argument term (second argument) passed to `start_link/3`. + + Returning `{:ok, state, data}` will cause `start_link/3` to return + `{:ok, pid}` and the process to enter its loop. + + Returning `{:ok, state, data, actions}` is similar to `{:ok, state}` + except the provided actions will be executed. + + Returning `:ignore` will cause `start_link/3` to return `:ignore` and the + process will exit normally without entering the loop or calling `terminate/2`. + If used when part of a supervision tree the parent supervisor will not fail + to start nor immediately try to restart the `GenStateMachine`. The remainder + of the supervision tree will be (re)started and so the `GenStateMachine` + should not be required by other processes. It can be started later with + `Supervisor.restart_child/2` as the child specification is saved in the parent + supervisor. The main use cases for this are: + + * The `GenStateMachine` is disabled by configuration but might be enabled + later. + * An error occurred and it will be handled by a different mechanism than the + `Supervisor`. Likely this approach involves calling + `Supervisor.restart_child/2` after a delay to attempt a restart. + + Returning `{:stop, reason}` will cause `start_link/3` to return + `{:error, reason}` and the process to exit with reason `reason` without + entering the loop or calling `terminate/2`. + + This function can optionally throw a result to return it. + """ + @callback init(args :: term) :: :gen_statem.init_result(state) + + @doc """ + Whenever a `GenStateMachine` in callback mode `:state_functions` receives a + call, cast, or normal process message, a state function is called. + + This spec exists to document the callback, but in actual use the name of the + function is probably not going to be `state_name`. Instead, there will be at + least one state function named after each state you wish to handle. See the + Examples section above for more info. + + These functions can optionally throw a result to return it. + + See the Erlang [documentation](https://erlang.org/doc/man/gen_statem.html#Module:StateName-3) + for a complete reference. + """ + @callback state_name(:enter, old_state_name :: state_name, data) :: + state_enter_result(state_name) + @callback state_name(event_type, event_content, data) :: event_handler_result(state_name) + + @doc """ + Whenever a `GenStateMachine` in callback mode `:handle_event_function` (the + default) receives a call, cast, or normal process messsage, this callback will + be invoked. + + This function can optionally throw a result to return it. + + See the Erlang [documentation](https://erlang.org/doc/man/gen_statem.html#Module:handle_event-4) + for a complete reference. + """ + @callback handle_event(:enter, old_state :: state, state, data) :: state_enter_result(state) + @callback handle_event(event_type, event_content, state, data) :: event_handler_result(state) + + @doc """ + Invoked when the server is about to exit. It should do any cleanup required. + + `reason` is exit reason, `state` is the current state, and `data` is the + current data of the `GenStateMachine`. The return value is ignored. + + `terminate/2` is called if a callback (except `init/1`) returns a `:stop` + tuple, raises, calls `Kernel.exit/1` or returns an invalid value. It may also + be called if the `GenStateMachine` traps exits using `Process.flag/2` *and* + the parent process sends an exit signal. + + If part of a supervision tree a `GenStateMachine`'s `Supervisor` will send an + exit signal when shutting it down. The exit signal is based on the shutdown + strategy in the child's specification. If it is `:brutal_kill` the + `GenStateMachine` is killed and so `terminate/2` is not called. However if it + is a timeout the `Supervisor` will send the exit signal `:shutdown` and the + `GenStateMachine` will have the duration of the timeout to call `terminate/2` + - if the process is still alive after the timeout it is killed. + + If the `GenStateMachine` receives an exit signal (that is not `:normal`) from + any process when it is not trapping exits it will exit abruptly with the same + reason and so not call `terminate/2`. Note that a process does *NOT* trap + exits by default and an exit signal is sent when a linked process exits or its + node is disconnected. + + Therefore it is not guaranteed that `terminate/2` is called when a + `GenStateMachine` exits. For such reasons, we usually recommend important + clean-up rules to happen in separated processes either by use of monitoring or + by links themselves. For example if the `GenStateMachine` controls a `port` + (e.g. `:gen_tcp.socket`) or `File.io_device`, they will be closed on receiving + a `GenStateMachine`'s exit signal and do not need to be closed in + `terminate/2`. + + If `reason` is not `:normal`, `:shutdown` nor `{:shutdown, term}` an error is + logged. + + This function can optionally throw a result, which is ignored. + """ + @callback terminate(reason :: term, state, data) :: any + + @doc """ + Invoked to change the state of the `GenStateMachine` when a different version + of a module is loaded (hot code swapping) and the state and/or data's term + structure should be changed. + + `old_vsn` is the previous version of the module (defined by the `@vsn` + attribute) when upgrading. When downgrading the previous version is wrapped in + a 2-tuple with first element `:down`. `state` is the current state of the + `GenStateMachine`, `data` is the current data, and `extra` is any extra data + required to change the state. + + Returning `{:ok, new_state, new_data}` changes the state to `new_state`, the + data to `new_data`, and the code change is successful. + + Returning `reason` fails the code change with reason `reason` and the state + and data remains the same. + + If `code_change/4` raises the code change fails and the loop will continue + with its previous state. Therefore this callback does not usually contain side + effects. + + This function can optionally throw a result to return it. + """ + @callback code_change(old_vsn :: term | {:down, vsn :: term}, state, data, extra :: term) :: + {:ok, state, data} + | (reason :: term) + + @doc """ + Invoked in some cases to retrieve a formatted version of the `GenStateMachine` + status. + + This callback can be useful to control the *appearance* of the status of the + `GenStateMachine`. For example, it can be used to return a compact + representation of the `GenStateMachines`'s state/data to avoid having large + terms printed. + + * one of `:sys.get_status/1` or `:sys.get_status/2` is invoked to get the + status of the `GenStateMachine`; in such cases, `reason` is `:normal` + + * the `GenStateMachine` terminates abnormally and logs an error; in such cases, + `reason` is `:terminate` + + `pdict_state_and_data` is a three-element list `[pdict, state, data]` where + `pdict` is a list of `{key, value}` tuples representing the current process + dictionary of the `GenStateMachine`, `state` is the current state of the + `GenStateMachine`, and `data` is the current data. + + This function can optionally throw a result to return it. + """ + @callback format_status(reason :: :normal | :terminate, pdict_state_and_data :: list) :: term + + @optional_callbacks state_name: 3, handle_event: 4, format_status: 2 + + @doc false + defmacro __using__(opts) do + quote location: :keep, bind_quoted: [opts: opts] do + @behaviour GenStateMachine + + {callback_mode, opts} = Keyword.pop(opts, :callback_mode, :handle_event_function) + + @doc false + def callback_mode do + unquote(Macro.escape(callback_mode)) + end + + @doc false + def init({state, data}) do + {:ok, state, data} + end + + @doc false + def terminate(_reason, _state, _data) do + :ok + end + + @doc false + def code_change(_old_vsn, _state, _data, _extra) do + :undefined + end + + unless Module.get_attribute(__MODULE__, :doc) do + @doc """ + Returns a specification to start this module under a supervisor. + + See `Supervisor`. + """ + end + + def child_spec(init_arg) do + Supervisor.child_spec( + %{id: __MODULE__, start: {__MODULE__, :start_link, [init_arg]}}, + unquote(Macro.escape(opts)) + ) + end + + defoverridable init: 1, terminate: 3, code_change: 4, child_spec: 1 + + if :handle_event_function in List.wrap(callback_mode) do + @doc false + def handle_event(_event_type, _event_content, _state, _data) do + {:stop, :bad_event} + end + + defoverridable handle_event: 4 + end + end + end + + @doc """ + Starts a `GenStateMachine` process linked to the current process. + + This is often used to start the `GenStateMachine` as part of a supervision + tree. + + Once the server is started, the `init/1` function of the given `module` is + called with `args` as its arguments to initialize the server. To ensure a + synchronized start-up procedure, this function does not return until `init/1` + has returned. + + Note that a `GenStateMachine` started with `start_link/3` is linked to the + parent process and will exit in case of crashes from the parent. The + `GenStateMachine` will also exit due to the `:normal` reasons in case it is + configured to trap exits in the `init/1` callback. + + ## Options + + * `:name` - used for name registration as described in the "Name + registration" section of the module documentation + + * `:timeout` - if present, the server is allowed to spend the given amount of + milliseconds initializing or it will be terminated and the start function + will return `{:error, :timeout}` + + * `:debug` - if present, the corresponding function in the [`:sys` + module](http://www.erlang.org/doc/man/sys.html) is invoked + + * `:spawn_opt` - if present, its value is passed as options to the + underlying process as in `Process.spawn/4` + + ## Return values + + If the server is successfully created and initialized, this function returns + `{:ok, pid}`, where `pid` is the pid of the server. If a process with the + specified server name already exists, this function returns + `{:error, {:already_started, pid}}` with the pid of that process. + + If the `init/1` callback fails with `reason`, this function returns + `{:error, reason}`. Otherwise, if it returns `{:stop, reason}` + or `:ignore`, the process is terminated and this function returns + `{:error, reason}` or `:ignore`, respectively. + """ + @spec start_link(module, any, GenServer.options()) :: on_start() + def start_link(module, args, options \\ []) do + {name, options} = Keyword.pop(options, :name) + + if name do + name = + if is_atom(name) do + {:local, name} + else + name + end + + :gen_statem.start_link(name, module, args, options) + else + :gen_statem.start_link(module, args, options) + end + end + + @doc """ + Starts a `GenStateMachine` process without links (outside of a supervision + tree). + + See `start_link/3` for more information. + """ + @spec start(module, any, GenServer.options()) :: on_start() + def start(module, args, options \\ []) do + {name, options} = Keyword.pop(options, :name) + + if name do + name = + if is_atom(name) do + {:local, name} + else + name + end + + :gen_statem.start(name, module, args, options) + else + :gen_statem.start(module, args, options) + end + end + + @doc """ + Stops the server with the given `reason`. + + The `terminate/2` callback of the given `server` will be invoked before + exiting. This function returns `:ok` if the server terminates with the + given reason; if it terminates with another reason, the call exits. + + This function keeps OTP semantics regarding error reporting. + If the reason is any other than `:normal`, `:shutdown` or + `{:shutdown, _}`, an error report is logged. + """ + @spec stop(server_ref(), reason :: term, timeout) :: :ok + def stop(server, reason \\ :normal, timeout \\ :infinity) do + :gen_statem.stop(server, reason, timeout) + end + + @doc """ + Makes a synchronous call to the `server` and waits for its reply. + + The client sends the given `request` to the server and waits until a reply + arrives or a timeout occurs. The appropriate state function will be called on + the server to handle the request. + + `server` can be any of the values described in the "Name registration" + section of the documentation for this module. + + ## Timeouts + + `timeout` is an integer greater than zero which specifies how many + milliseconds to wait for a reply, or the atom `:infinity` to wait + indefinitely. The default value is `:infinity`. If no reply is received within + the specified time, the function call fails and the caller exits. + + If the caller catches an exit, to avoid getting a late reply in the caller's + inbox, this function spawns a proxy process that does the call. A late reply + gets delivered to the dead proxy process, and hence gets discarded. This is + less efficient than using `:infinity` as a timeout. + """ + @spec call(server_ref(), term, timeout) :: term + def call(server, request, timeout \\ :infinity) do + :gen_statem.call(server, request, timeout) + end + + @doc """ + Sends an asynchronous request to the `server`. + + This function always returns `:ok` regardless of whether + the destination `server` (or node) exists. Therefore it + is unknown whether the destination `server` successfully + handled the message. + + The appropriate state function will be called on the server to handle + the request. + """ + @spec cast(server_ref(), term) :: :ok + def cast(server, request) do + :gen_statem.cast(server, request) + end + + @doc """ + Sends replies to clients. + + Can be used to explicitly send replies to multiple clients. + + This function always returns `:ok`. + + See `reply/2` for more information. + """ + @spec reply([:gen_statem.reply_action()] | :gen_statem.reply_action()) :: :ok + def reply(replies) do + :gen_statem.reply(replies) + end + + @doc """ + Replies to a client. + + This function can be used to explicitly send a reply to a client that called + `call/3` when the reply cannot be specified in the return value of a state + function. + + `client` must be the `from` element of the event type accepted by state + functions. `reply` is an arbitrary term which will be given + back to the client as the return value of the call. + + Note that `reply/2` can be called from any process, not just the one + that originally received the call (as long as that process communicated the + `from` argument somehow). + + This function always returns `:ok`. + + ## Examples + + def handle_event({:call, from}, :reply_in_one_second, state, data) do + Process.send_after(self(), {:reply, from}, 1_000) + :keep_state_and_data + end + + def handle_event(:info, {:reply, from}, state, data) do + GenStateMachine.reply(from, :one_second_has_passed) + end + + """ + @spec reply(:gen_statem.from(), term) :: :ok + def reply(client, reply) do + :gen_statem.reply(client, reply) + end +end diff --git a/server/deps/gen_state_machine/lib/gen_state_machine/application.ex b/server/deps/gen_state_machine/lib/gen_state_machine/application.ex new file mode 100644 index 0000000..2d0b406 --- /dev/null +++ b/server/deps/gen_state_machine/lib/gen_state_machine/application.ex @@ -0,0 +1,11 @@ +defmodule GenStateMachine.Application do + @moduledoc false + + use Application + + @doc false + def start(_type, _args) do + Logger.add_translator({GenStateMachine.Translator, :translate}) + Supervisor.start_link([], strategy: :one_for_one) + end +end diff --git a/server/deps/gen_state_machine/lib/gen_state_machine/translator.ex b/server/deps/gen_state_machine/lib/gen_state_machine/translator.ex new file mode 100644 index 0000000..e5d5f13 --- /dev/null +++ b/server/deps/gen_state_machine/lib/gen_state_machine/translator.ex @@ -0,0 +1,131 @@ +defmodule GenStateMachine.Translator do + @moduledoc false + + @doc false + # OTP21 and after + def translate(min_level, :error, :report, {:logger, %{label: label} = report}) do + case label do + {:gen_statem, :terminate} -> + do_translate(min_level, report) + + _ -> + :none + end + end + + # OTP20 and before + def translate(min_level, :error, :format, message) do + opts = Application.get_env(:logger, :translator_inspect_opts) + + case message do + {'** State machine ~tp terminating~n' ++ _ = format, args} -> + do_translate(min_level, format, args, opts) + + {'** State machine ~p terminating~n' ++ _ = format, args} -> + do_translate(min_level, format, args, opts) + + _ -> + :none + end + end + + def translate(_min_level, _level, _kind, _message) do + :none + end + + # OTP21 and after + defp do_translate(min_level, report) do + inspect_opts = Application.get_env(:logger, :translator_inspect_opts) + + %{name: name, state: state} = report + + msg = ["GenStateMachine #{inspect(name)} terminating", statem_exception(report)] + + if min_level == :debug do + msg = [msg, "\nState: ", inspect(state, inspect_opts)] + {:ok, statem_debug(report, inspect_opts, msg)} + else + {:ok, msg} + end + end + + # OTP20 and before + defp do_translate(min_level, format, args, opts) do + keys = + format + |> to_string() + |> String.split(~r/~tp|~p/, trim: true) + |> Enum.flat_map(&map_key/1) + + args = + [keys, args] + |> List.zip() + |> Map.new() + + msg = [ + "GenStateMachine #{inspect(args.name)} terminating" + | statem_exception(args) + ] + + if min_level == :debug do + {:ok, statem_debug(args, opts, msg)} + else + {:ok, msg} + end + end + + # OTP21 and later + defp statem_exception(%{reason: {class, reason, stack}}) do + do_statem_exception(class, reason, stack) + end + + # OTP20 and before + defp statem_exception(%{class: class, reason: reason, stack: stack}) do + do_statem_exception(class, reason, stack) + end + + defp do_statem_exception(class, reason, stack) do + formatted = Exception.format(class, reason, stack) + [?\n | :erlang.binary_part(formatted, 0, byte_size(formatted) - 1)] + end + + defp map_key(arg) do + String.split(arg, ~r/\*\* |~n/, trim: true) + |> Enum.filter(&(String.contains?(&1, "=") || String.contains?(&1, "State machine"))) + |> case do + [] -> [] + ["State machine" <> _] -> [:name] + ["Last event" <> _] -> [:last_event] + ["When server state" <> _] -> [:state] + ["Reason for termination" <> _] -> [:class, :reason] + ["Callback mode" <> _] -> [:callback_mode] + ["Stacktrace" <> _] -> [:stack] + ["Queued" <> _] -> [:queued] + ["Postponed" <> _] -> [:postponed] + end + end + + defp statem_debug(args, opts, msg) do + [msg, Enum.map(Enum.sort(args), &translate_arg(&1, opts))] + end + + defp translate_arg({:last_event, last_event}, opts), + do: ["\nLast event: " | inspect(last_event, opts)] + + defp translate_arg({:state, state}, opts), + do: ["\nState: " | inspect(state, opts)] + + defp translate_arg({:callback_mode, callback_mode}, opts), + do: ["\nCallback mode: " | inspect(callback_mode, opts)] + + defp translate_arg({:queued, queued}, opts), + do: ["\nQueued events: " | inspect(queued, opts)] + + defp translate_arg({:queue, [last | queued]}, opts), + do: ["\nLast event: ", inspect(last, opts), "\nQueued events: " | inspect(queued, opts)] + + defp translate_arg({:postponed, postponed}, opts), + do: ["\nPostponed events: " | inspect(postponed, opts)] + + defp translate_arg(_arg, _opts), do: [] +end diff --git a/server/deps/gen_state_machine/mix.exs b/server/deps/gen_state_machine/mix.exs new file mode 100644 index 0000000..2461ddf --- /dev/null +++ b/server/deps/gen_state_machine/mix.exs @@ -0,0 +1,64 @@ +otp_release = + :erlang.system_info(:otp_release) + |> to_string() + |> String.split(".") + |> List.first() + |> String.to_integer() + +if otp_release < 20 do + IO.warn("gen_state_machine requires Erlang/OTP 20 or greater", []) +end + +defmodule GenStateMachine.Mixfile do + use Mix.Project + + @version "3.0.0" + + def project do + [ + app: :gen_state_machine, + version: @version, + elixir: "~> 1.5", + build_embedded: Mix.env() == :prod, + start_permanent: Mix.env() == :prod, + deps: deps(), + description: description(), + package: package(), + source_url: "https://github.com/ericentin/gen_state_machine", + docs: [ + main: "GenStateMachine", + extras: ["README.md"], + source_ref: "v#{@version}" + ] + ] + end + + def application do + [ + extra_applications: [:logger], + mod: {GenStateMachine.Application, []} + ] + end + + defp deps do + [ + {:ex_doc, "~> 0.23", only: :dev, runtime: false}, + {:dialyxir, "~> 1.0", only: :dev, runtime: false} + ] + end + + defp description do + "An Elixir wrapper for gen_statem." + end + + defp package do + [ + files: ["lib", "mix.exs", "README.md", "LICENSE"], + maintainers: ["Eric Entin"], + licenses: ["Apache 2.0"], + links: %{ + "GitHub" => "https://github.com/ericentin/gen_state_machine" + } + ] + end +end diff --git a/server/deps/jason/.hex b/server/deps/jason/.hex new file mode 100644 index 0000000..366c06a Binary files /dev/null and b/server/deps/jason/.hex differ diff --git a/server/deps/jason/CHANGELOG.md b/server/deps/jason/CHANGELOG.md new file mode 100644 index 0000000..c37dd2a --- /dev/null +++ b/server/deps/jason/CHANGELOG.md @@ -0,0 +1,132 @@ +# Changelog + +## 1.4.4 (26.07.2024) + +* Fix warnings on Elixir 1.17 by conditionally compiling Decimal support + +## 1.4.3 (29.06.2024) + +* Fix derive with _ struct key + +## 1.4.2 (29.06.2024) + +* Fix compiler warnings for Elixir 1.17 + +## 1.4.1 (06.07.2023) + +* Add limit to decoded integer sizes of 1024 digits. This can be changed + with the `decoding_integer_digit_limit` app env config. + +## 1.4.0 (12.09.2022) + +### Enhancements + +* Use the `:erlang.float_to_binary(_, [:short])` function, instead of `io_lib_format.fwrite_g/1` + where available (OTP 24.1+). This provides equivalent output with much less memory used + and significantly improved performance. + +## 1.3.0 (21.12.2021) + +### Enhancements + +* Add the `Jason.OrderedObject` struct +* Support decoding objects preserving all the keys with `objects: :ordered_objects` option +* Support decoding floats to `Decimal` with `floats: :decimals` option +* Add `~j` and `~J` sigils in module `Jason.Sigil` to support writing JSON literals in code + +### Fixes +* Fix error reporting when decoding strings (it was possible to mis-attribute the offending byte) +* Verify fields given to `@derive` + +## 1.2.2 (08.09.2020) + +### Enhancements + +* Support Decimal 2.0 + +## 1.2.1 (04.05.2020) + +### Security + +* Fix `html_safe` escaping in `Jason.encode` + + The `