Module hb_store_gateway.erl¶
A store module that reads data from the nodes Arweave gateway and GraphQL routes, additionally including additional store-specific routes.
Function Index¶
cache_read_message_test/0* | Ensure that saving to the gateway store works. |
external_http_access_test/0* | Test that the default node config allows for data to be accessed. |
graphql_as_store_test_/0* | Store is accessible via the default options. |
graphql_from_cache_test/0* | Stored messages are accessible via hb_cache accesses. |
list/2 | |
manual_local_cache_test/0* | |
maybe_cache/2* | Cache the data if the cache is enabled. |
read/2 | Read the data at the given key from the GraphQL route. |
resolve/2 | |
scope/1 | The scope of a GraphQL store is always remote, due to performance. |
specific_route_test/0* | Routes can be specified in the options, overriding the default routes. |
store_opts_test/0* | Test to verify store opts is being set for Data-Protocol ao. |
type/2 | Get the type of the data at the given key. |
verifiability_test/0* | Test that items retreived from the gateway store are verifiable. |
Function Details¶
cache_read_message_test/0 *¶
cache_read_message_test() -> any()
Ensure that saving to the gateway store works.
external_http_access_test/0 *¶
external_http_access_test() -> any()
Test that the default node config allows for data to be accessed.
graphql_as_store_test_/0 *¶
graphql_as_store_test_() -> any()
Store is accessible via the default options.
graphql_from_cache_test/0 *¶
graphql_from_cache_test() -> any()
Stored messages are accessible via hb_cache
accesses.
list/2¶
list(StoreOpts, Key) -> any()
manual_local_cache_test/0 *¶
manual_local_cache_test() -> any()
maybe_cache/2 *¶
maybe_cache(StoreOpts, Data) -> any()
Cache the data if the cache is enabled. The store
option may either
be false
to disable local caching, or a store definition to use as the
cache.
read/2¶
read(StoreOpts, Key) -> any()
Read the data at the given key from the GraphQL route. Will only attempt to read the data if the key is an ID.
resolve/2¶
resolve(X1, Key) -> any()
scope/1¶
scope(X1) -> any()
The scope of a GraphQL store is always remote, due to performance.
specific_route_test/0 *¶
specific_route_test() -> any()
Routes can be specified in the options, overriding the default routes. We test this by inversion: If the above cache read test works, then we know that the default routes allow access to the item. If the test below were to produce the same result, despite an empty 'only' route list, then we would know that the module is not respecting the route list.
store_opts_test/0 *¶
store_opts_test() -> any()
Test to verify store opts is being set for Data-Protocol ao
type/2¶
type(StoreOpts, Key) -> any()
Get the type of the data at the given key. We potentially cache the result, so that we don't have to read the data from the GraphQL route multiple times.
verifiability_test/0 *¶
verifiability_test() -> any()
Test that items retreived from the gateway store are verifiable.