diff options
author | Pierre de Lacroix <pierre@pdelacroix.com> | 2020-10-19 18:04:56 +0000 |
---|---|---|
committer | Pierre de Lacroix <pierre@pdelacroix.com> | 2020-10-19 18:04:56 +0000 |
commit | 4c0fb5e1c89eb7d83eb46ce992bbb8b7b5b80130 (patch) | |
tree | 584a3f3100dc76bb9f7a58e4330d5a866c784d68 /lib/matrix_app_service.ex | |
parent | Merge branch 'test-ci' into 'master' (diff) | |
parent | test: add tests for controllers (diff) |
Merge branch 'controller_tests' into 'master'
test: add tests for controllers (closes #4)
Closes #4
See merge request kazarma/matrix_app_service.ex!8
Diffstat (limited to 'lib/matrix_app_service.ex')
-rw-r--r-- | lib/matrix_app_service.ex | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/matrix_app_service.ex b/lib/matrix_app_service.ex index 49acd1b..289d276 100644 --- a/lib/matrix_app_service.ex +++ b/lib/matrix_app_service.ex @@ -21,6 +21,7 @@ defmodule MatrixAppService do In your Phoenix Router: ``` + require MatrixAppServiceWeb.Router MatrixAppServiceWeb.Router.routes() ``` @@ -33,20 +34,26 @@ defmodule MatrixAppService do For instance: ``` + @behaviour MatrixAppService.Adapter.Room + @impl MatrixAppService.Adapter.Room def query_alias(room_alias) do # Do something with the room alias # If the room exists, return :ok end + @behaviour MatrixAppService.Adapter.User + @impl MatrixAppService.Adapter.User def query_user(user_id) do # Do something with the user ID # If the user exists, return :ok end + @behaviour MatrixAppService.Adapter.Transaction + @impl MatrixAppService.Adapter.Transaction - def new_event(%MatrixAppService.Event{type: type, content: content}) + def new_event(%MatrixAppService.Event{type: type, content: content}) do # Do something with the event end ``` |