feat: Implement runtime API cache store and related configurations
- Added RuntimeApiCacheStore for managing API cache entries in memory. - Introduced StorageTarget enum to define various storage targets. - Created StoredCacheEntry record to encapsulate cache entries. - Defined SyncState enum to represent the synchronization state of cache entries. - Added ControlPlaneConfigurationSource enum for different configuration sources. - Developed ControlPlaneRuntimeConfig class for runtime configuration management. - Implemented ControlPlaneStartupConfigResolver for resolving configuration from various sources. - Created ControlPlaneStartupSettings to hold startup configuration values. - Added ResolvedControlPlaneStartupConfig record to encapsulate resolved configuration. - Implemented tests for batch client and cache client functionalities. - Added tests for ControlPlaneStartupConfigResolver to validate configuration resolution logic.
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
# Generated SDK
|
||||
|
||||
The generated SDK is a Java view of the control-plane route contract.
|
||||
|
||||
Generated files live under:
|
||||
|
||||
```text
|
||||
src/main/java/net/kewwbec/network/generated/api/v1
|
||||
```
|
||||
|
||||
These files include:
|
||||
|
||||
- route names
|
||||
- allowed HTTP methods
|
||||
- URI templates
|
||||
- required abilities
|
||||
- middleware metadata
|
||||
- request field descriptors
|
||||
- response type descriptors
|
||||
|
||||
## Usage
|
||||
|
||||
Import the generated root:
|
||||
|
||||
```java
|
||||
import net.kewwbec.network.generated.api.v1.ControlPlaneApiV1;
|
||||
```
|
||||
|
||||
Use domain APIs to inspect route descriptors:
|
||||
|
||||
```java
|
||||
ControlPlaneApiV1 api = ControlPlaneApiV1.INSTANCE;
|
||||
String version = api.apiVersion();
|
||||
int endpointCount = api.endpointCount();
|
||||
```
|
||||
|
||||
Use route endpoint constants with handwritten clients or batching:
|
||||
|
||||
```java
|
||||
String uri = PathBuilder.resolve(
|
||||
SessionProfileEndpoint.VALUE.uri(),
|
||||
"player",
|
||||
playerId
|
||||
);
|
||||
```
|
||||
|
||||
## Regeneration
|
||||
|
||||
The source of truth is `../core-control-plane`.
|
||||
|
||||
Run from `core-control-plane`:
|
||||
|
||||
```bash
|
||||
php artisan control-plane:sync-network-sdk --dry-run
|
||||
php artisan control-plane:sync-network-sdk
|
||||
```
|
||||
|
||||
Review generated churn carefully before committing. Broad generated diffs can happen if `core-control-plane` has unrelated route changes.
|
||||
|
||||
## Rules
|
||||
|
||||
- Do not manually patch generated Java.
|
||||
- Fix Laravel routes, requests, resources, or the generator upstream.
|
||||
- Re-run the sync after route changes.
|
||||
- Keep handwritten Java under `net.kewwbec.network`, outside `generated`.
|
||||
Reference in New Issue
Block a user