open_api_spex v3.9.0 OpenApiSpex.Plug.Cache behaviour View Source
Cache for OpenApiSpex
Settings:
config :open_api_spex, :cache_adapter, Module
There are already had three cache adapter:
OpenApiSpex.Plug.PersistentTermCache
- defaultOpenApiSpex.Plug.AppEnvCache
- if VM not supportedpersistent_term
OpenApiSpex.Plug.NoneCache
- none cache
If you are constantly modifying specs during development, you can setting
like this in dev.exs
:
config :open_api_spex, :cache_adapter, OpenApiSpex.Plug.NoneCache
Link to this section Summary
Link to this section Functions
Link to this function
adapter()
View Source
adapter()
View Source
adapter() :: module()
adapter() :: module()
Get cache adapter
Link to this function
refresh()
View Source
refresh()
View Source
refresh() :: :ok
refresh() :: :ok
Only erase cache, put again when plug starting
Link to this section Callbacks
Link to this callback
erase(module)
View Source
erase(module)
View Source
erase(module()) :: :ok
erase(module()) :: :ok
Link to this callback
get(module)
View Source
get(module)
View Source
get(module()) :: {OpenApiSpex.OpenApi.t(), map()} | nil
get(module()) :: {OpenApiSpex.OpenApi.t(), map()} | nil
Link to this callback
put(module, {})
View Source
put(module, {})
View Source
put(module(), {OpenApiSpex.OpenApi.t(), map()}) :: :ok
put(module(), {OpenApiSpex.OpenApi.t(), map()}) :: :ok