mobilizon/lib/web/cache/cache.ex

44 lines
2.3 KiB
Elixir
Raw Permalink Normal View History

2020-01-26 21:36:50 +01:00
defmodule Mobilizon.Web.Cache do
2019-09-17 23:39:26 +02:00
@moduledoc """
Facade module which provides access to all cached data.
"""
alias Mobilizon.Actors.{Actor, Member}
alias Mobilizon.Conversations.Conversation
alias Mobilizon.Discussions.{Comment, Discussion}
alias Mobilizon.Events.Event
alias Mobilizon.Posts.Post
alias Mobilizon.Resources.Resource
alias Mobilizon.Todos.{Todo, TodoList}
2020-01-26 21:36:50 +01:00
alias Mobilizon.Web.Cache.ActivityPub
2019-09-17 23:39:26 +02:00
@type local_actor :: %Actor{domain: nil}
@spec get_actor_by_name(binary) :: {:commit, Actor.t()} | {:ignore, nil}
defdelegate get_actor_by_name(name), to: ActivityPub
@spec get_local_actor_by_name(binary) :: {:commit, Actor.t()} | {:ignore, nil}
2019-09-17 23:39:26 +02:00
defdelegate get_local_actor_by_name(name), to: ActivityPub
@spec get_public_event_by_uuid_with_preload(binary) :: {:commit, Event.t()} | {:ignore, nil}
2019-09-17 23:39:26 +02:00
defdelegate get_public_event_by_uuid_with_preload(uuid), to: ActivityPub
@spec get_comment_by_uuid_with_preload(binary) :: {:commit, Comment.t()} | {:ignore, nil}
2019-09-17 23:39:26 +02:00
defdelegate get_comment_by_uuid_with_preload(uuid), to: ActivityPub
@spec get_resource_by_uuid_with_preload(binary) :: {:commit, Resource.t()} | {:ignore, nil}
defdelegate get_resource_by_uuid_with_preload(uuid), to: ActivityPub
@spec get_todo_list_by_uuid_with_preload(binary) :: {:commit, TodoList.t()} | {:ignore, nil}
defdelegate get_todo_list_by_uuid_with_preload(uuid), to: ActivityPub
@spec get_todo_by_uuid_with_preload(binary) :: {:commit, Todo.t()} | {:ignore, nil}
defdelegate get_todo_by_uuid_with_preload(uuid), to: ActivityPub
@spec get_conversation_by_id_with_preload(binary) ::
{:commit, Conversation.t()} | {:ignore, nil}
defdelegate get_conversation_by_id_with_preload(uuid), to: ActivityPub
@spec get_member_by_uuid_with_preload(binary) :: {:commit, Member.t()} | {:ignore, nil}
defdelegate get_member_by_uuid_with_preload(uuid), to: ActivityPub
@spec get_post_by_slug_with_preload(binary) :: {:commit, Post.t()} | {:ignore, nil}
defdelegate get_post_by_slug_with_preload(slug), to: ActivityPub
@spec get_discussion_by_slug_with_preload(binary) :: {:commit, Discussion.t()} | {:ignore, nil}
defdelegate get_discussion_by_slug_with_preload(slug), to: ActivityPub
@spec get_relay :: {:commit, Actor.t()} | {:ignore, nil}
2019-09-17 23:39:26 +02:00
defdelegate get_relay, to: ActivityPub
end