ex_api v1.0.0-rc.2 ExApi View Source
This module manages all apis and theirs implementations.
Link to this section Summary
Functions
Lists all registered apis
Checks given api
Checks implementation with api
Checks implementation
Fetches api
Fetches default implementation for specified api
Fetches fallback implementation for specified api
Check support of feature for specific implementation
Check support of feature for specific api and implementation
Fetches implementation
Fetches implementation for specified group and api
Fetches all implementations for specified api
Returns server state
Callback implementation of: GenServer.init/1
Registers api asynchronously
Registers api fallback implementation asynchronously
Registers api implementation asynchronously
Registers api implementation asynchronously
Changes default api implementation asynchronously
Changes default api implementation asynchronously
Starts ExApi server
Stops ExApi and all apis servers
Unregisters api asynchronously
Unregisters api fallback asynchronously
Unregisters api implementation asynchronously
Unregisters api implementation asynchronously
Link to this section Functions
Lists all registered apis.
check_api(ExApi.Api.t) :: {:ok, ExApi.Api.t} | {:error, ExApi.Error.ApiMismatchError.t} | {:error, ExApi.Error.ApiNotRegisteredError.t}
check_api(module) :: {:ok, ExApi.Api.t} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotApiError.t}
Checks given api
check_api_impl(ExApi.Api.t, ExApi.Implementation.t) :: {:ok, ExApi.Implementation.t} | {:error, ExApi.Error.ApiMismatchError.t} | {:error, ExApi.Error.ApiNotRegisteredError.t} | {:error, ExApi.Error.ImplementationMismatchError.t} | {:error, ExApi.Error.ImplementationNotRegisteredError.t} | {:error, ExApi.Error.WrongApiError.t}
check_api_impl(ExApi.Api.t, {group :: atom, id :: atom} | id :: atom) :: {:ok, ExApi.Implementation.t} | {:error, ExApi.Error.ApiMismatchError.t} | {:error, ExApi.Error.ApiNotRegisteredError.t} | {:error, ExApi.Error.ImplementationNotFoundError.t}
check_api_impl(module, ExApi.Implementation.t) :: {:ok, ExApi.Implementation.t} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ImplementationMismatchError.t} | {:error, ExApi.Error.ImplementationNotRegisteredError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotApiError.t}
check_api_impl(module, {group :: atom, id :: atom} | id :: atom) :: {:ok, ExApi.Implementation.t} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ImplementationNotFoundError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotApiError.t}
Checks implementation with api.
check_impl(ExApi.Implementation.t) :: {:ok, ExApi.Implementation.t} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ImplementationNotFoundError.t}
check_impl(module) :: {:ok, ExApi.Implementation.t} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ImplementationNotFoundError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotImplementationError.t}
Checks implementation.
get(ExApi.Api.t) :: {:ok, ExApi.Api.t} | {:error, ExApi.Error.ApiMismatchError.t} | {:error, ExApi.Error.ApiNotRegisteredError.t}
get(module) :: {:ok, ExApi.Api.t} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotApiError.t}
Fetches api.
get_default_impl(ExApi.Api.t) :: {:ok, ExApi.Implementation.t | nil} | {:error, ExApi.Error.ApiMismatchError.t} | {:error, ExApi.Error.ApiNotRegisteredError.t}
get_default_impl(module) :: {:ok, ExApi.Implementation.t | nil} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotApiError.t}
Fetches default implementation for specified api.
get_fallback_impl(ExApi.Api.t) :: {:ok, ExApi.Implementation.t | nil} | {:error, ExApi.Error.ApiMismatchError.t} | {:error, ExApi.Error.ApiNotRegisteredError.t}
get_fallback_impl(module) :: {:ok, ExApi.Implementation.t | nil} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotApiError.t}
Fetches fallback implementation for specified api.
get_feature_support(ExApi.Implementation.t, {name :: atom, arity :: non_neg_integer}) :: {:ok, Feature.support} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.FeatureNotFoundError.t} | {:error, ExApi.Error.ImplementationNotFoundError.t}
get_feature_support(module, {name :: atom, arity :: non_neg_integer}) :: {:ok, Feature.support} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.FeatureNotFoundError.t} | {:error, ExApi.Error.ImplementationNotFoundError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotImplementationError.t}
Check support of feature for specific implementation.
get_feature_support(ExApi.Api.t, ExApi.Implementation.t, {name :: atom, arity :: non_neg_integer}) :: {:ok, Feature.support} | {:error, ExApi.Error.ApiMismatchError.t} | {:error, ExApi.Error.ApiNotRegisteredError.t} | {:error, ExApi.Error.FeatureNotFoundError.t} | {:error, ExApi.Error.ImplementationMismatchError.t} | {:error, ExApi.Error.ImplementationNotRegisteredError.t} | {:error, ExApi.Error.WrongApiError.t}
get_feature_support(ExApi.Api.t, {group :: atom, id :: atom} | id :: atom, {name :: atom, arity :: non_neg_integer}) :: {:ok, Feature.support} | {:error, ExApi.Error.ApiMismatchError.t} | {:error, ExApi.Error.ApiNotRegisteredError.t} | {:error, ExApi.Error.FeatureNotFoundError.t} | {:error, ExApi.Error.ImplementationNotFoundError.t}
get_feature_support(module, ExApi.Implementation.t, {name :: atom, arity :: non_neg_integer}) :: {:ok, Feature.support} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.FeatureNotFoundError.t} | {:error, ExApi.Error.ImplementationMismatchError.t} | {:error, ExApi.Error.ImplementationNotRegisteredError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotApiError.t}
get_feature_support(module, {group :: atom, id :: atom} | id :: atom, {name :: atom, arity :: non_neg_integer}) :: {:ok, Feature.support} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.FeatureNotFoundError.t} | {:error, ExApi.Error.ImplementationNotFoundError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotApiError.t}
Check support of feature for specific api and implementation.
get_impl(ExApi.Implementation.t) :: {:ok, ExApi.Implementation.t} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ImplementationNotFoundError.t}
get_impl(module) :: {:ok, ExApi.Implementation.t} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ImplementationNotFoundError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotImplementationError.t}
Fetches implementation.
get_impl(ExApi.Api.t, ExApi.Implementation.t) :: {:ok, ExApi.Implementation.t} | {:error, ExApi.Error.ApiMismatchError.t} | {:error, ExApi.Error.ApiNotRegisteredError.t} | {:error, ExApi.Error.ImplementationMismatchError.t} | {:error, ExApi.Error.ImplementationNotRegisteredError.t} | {:error, ExApi.Error.WrongApiError.t}
get_impl(ExApi.Api.t, {group :: atom, id :: atom} | id :: atom) :: {:ok, ExApi.Implementation.t} | {:error, ExApi.Error.ApiMismatchError.t} | {:error, ExApi.Error.ApiNotRegisteredError.t} | {:error, ExApi.Error.ImplementationNotFoundError.t}
get_impl(module, ExApi.Implementation.t) :: {:ok, ExApi.Implementation.t} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ImplementationMismatchError.t} | {:error, ExApi.Error.ImplementationNotRegisteredError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotApiError.t}
get_impl(module, {group :: atom, id :: atom} | id :: atom) :: {:ok, ExApi.Implementation.t} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ImplementationNotFoundError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotApiError.t}
Fetches implementation for specified group and api.
get_impls(ExApi.Api.t) :: {:ok, [ExApi.Implementation.t]} | {:error, ExApi.Error.ApiMismatchError.t} | {:error, ExApi.Error.ApiNotRegisteredError.t}
get_impls(module) :: {:ok, [ExApi.Implementation.t]} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotApiError.t}
Fetches all implementations for specified api.
get_state() :: {:ok, %{optional(module) => ExApi.Api.t}}
Returns server state
init(args :: term) :: {:ok, state} | {:ok, state, timeout | :hibernate} | :ignore | {:stop, reason :: any} when state: any
Callback implementation of: GenServer.init/1
.
register_api(ExApi.Api.t | module) :: {:ok, pid} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotApiError.t}
Registers api asynchronously.
register_fallback_impl(ExApi.Implementation.t) :: {:ok, pid} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.NotApiError.t}
register_fallback_impl(module) :: {:ok, pid} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotApiError.t} | {:error, ExApi.Error.NotImplementationError.t}
Registers api fallback implementation asynchronously.
register_impl(ExApi.Implementation.t) :: {:ok, pid} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.NotApiError.t}
register_impl(module) :: {:ok, pid} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotApiError.t} | {:error, ExApi.Error.NotImplementationError.t}
Registers api implementation asynchronously.
register_impl(ExApi.Implementation.t | module, atom) :: {:ok, pid} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotApiError.t} | {:error, ExApi.Error.NotImplementationError.t}
Registers api implementation asynchronously.
set_default_impl(ExApi.Implementation.t) :: {:ok, pid} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ImplementationNotFoundError.t}
set_default_impl(module) :: {:ok, pid} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ImplementationNotFoundError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotImplementationError.t}
Changes default api implementation asynchronously.
set_default_impl(ExApi.Api.t, ExApi.Implementation.t) :: {:ok, pid} | {:error, ExApi.Error.ApiMismatchError.t} | {:error, ExApi.Error.ApiNotRegisteredError.t} | {:error, ExApi.Error.ImplementationMismatchError.t} | {:error, ExApi.Error.ImplementationNotRegisteredError.t} | {:error, ExApi.Error.WrongApiError.t}
set_default_impl(ExApi.Api.t, {group :: atom, id :: atom} | id :: atom) :: {:ok, pid} | {:error, ExApi.Error.ApiMismatchError.t} | {:error, ExApi.Error.ApiNotRegisteredError.t} | {:error, ExApi.Error.ImplementationNotFoundError.t}
set_default_impl(module, ExApi.Implementation.t) :: {:ok, pid} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ImplementationMismatchError.t} | {:error, ExApi.Error.ImplementationNotRegisteredError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotApiError.t}
set_default_impl(module, {group :: atom, id :: atom} | id :: atom) :: {:ok, pid} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ImplementationNotFoundError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotApiError.t}
Changes default api implementation asynchronously.
Starts ExApi server.
Stops ExApi and all apis servers.
unregister_api(ExApi.Api.t) :: {:ok, pid} | {:error, ExApi.Error.ApiMismatchError.t} | {:error, ExApi.Error.ApiNotRegisteredError.t}
unregister_api(module) :: {:ok, pid} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotApiError.t}
Unregisters api asynchronously.
unregister_fallback_impl(ExApi.Api.t) :: {:ok, pid} | {:error, ExApi.Error.ApiMismatchError.t} | {:error, ExApi.Error.ApiNotRegisteredError.t}
unregister_fallback_impl(module) :: {:ok, pid} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotApiError.t}
Unregisters api fallback asynchronously.
unregister_impl(ExApi.Implementation.t) :: {:ok, pid} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ImplementationNotFoundError.t}
unregister_impl(module) :: {:ok, pid} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ImplementationNotFoundError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotImplementationError.t}
Unregisters api implementation asynchronously.
unregister_impl(ExApi.Implementation.t, atom) :: {:ok, pid} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ImplementationNotFoundError.t}
unregister_impl(module, atom) :: {:ok, pid} | {:error, ExApi.Error.ApiNotFoundError.t} | {:error, ExApi.Error.ImplementationNotFoundError.t} | {:error, ExApi.Error.ModuleNotLoadedError.t} | {:error, ExApi.Error.NotImplementationError.t}
Unregisters api implementation asynchronously.