Gonon Core is the foundation package for the entire Gonon ecosystem. It provides reusable, vendor-agnostic, and framework-agnostic infrastructure shared by every Gonon SDK.
- HTTP Abstraction via PSR interfaces
- Configuration management
- Unified Exception hierarchy
- Retry mechanisms (Exponential Backoff, Fixed Delay)
- Collections and DTO foundations
- Authentication contracts
- Testing utilities
- PHP 8.2 or higher
You can install the package via composer:
composer require gonon/coreGonon Core uses immutable configuration objects.
use Gonon\Core\Configuration\Config;
use Gonon\Core\Configuration\Environment;
$config = new Config(
environment: Environment::Production,
timeout: 30,
);Core is primarily used by SDKs to build robust HTTP integrations.
// 1. Choose your transport adapter (e.g. from gonon/http-symfony)
$adapter = new \Gonon\Http\Symfony\SymfonyHttpClient();
// 2. (Optional) Configure a retry strategy
$retry = new \Gonon\Core\Retry\ExponentialBackoffStrategy(maxAttempts: 3, baseDelayMs: 500);
// 3. Initialize the Orchestrator
$client = new \Gonon\Core\Http\Client(
adapter: $adapter,
retryStrategy: $retry,
defaultHeaders: ['User-Agent' => 'Gonon-SDK/1.0']
);
// 4. Send Request (Middlewares, Retries, and Logging run automatically!)
$response = $client->sendRequest($request);Check the examples/ directory for full usage examples.
The full API reference is available within the source code via PHPDoc annotations.
composer testPlease see CONTRIBUTING.md for details.
The MIT License (MIT). Please see LICENSE for more information.