Pike.Store.ETS (pike v0.3.0)

View Source

Default in-memory ETS-based API key store for Pike.

Stores key structs with permissions like:

%{
  key: "abc123",
  enabled: true,
  permissions: [
    %{resource: "Products", scopes: [:read, :write]}
  ]
}

Customizing the ETS Table

There are two ways to use a custom table name:

  1. Configure the default table name globally:
# In your config.exs
config :pike, :ets_table_name, :my_custom_table_name
  1. Create a parameterized store with the use macro:
defmodule MyApp.CustomStore do
  use Pike.Store.ETS, table_name: :my_custom_table
end

# Then configure Pike to use it
config :pike, store: MyApp.CustomStore

This approach allows multiple Pike instances with separate ETS tables.