Created
January 2, 2017 14:15
-
-
Save a-ast/13e084b764fb8b896ab9810ed0e8da71 to your computer and use it in GitHub Desktop.
Github client with plugins services
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
# Custom plugin | |
github_api.plugin.wait_and_retry: | |
class: AppBundle\Client\Github\WaitAndRetryPlugin | |
# Bundled plugin | |
github_api.plugin.authentication: | |
class: Github\HttpClient\Plugin\Authentication | |
arguments: | |
- '%env(GITHUB_CLIENT_ID)%' | |
- '%env(GITHUB_CLIENT_SECRET)%' | |
- 'url_client_id' | |
# HTTP client | |
github_api.http_client: | |
class: Http\Adapter\Guzzle6\Client | |
# HTTP client builder | |
github_api.http_client_builder: | |
class: Github\HttpClient\Builder | |
arguments: | |
- '@github_api.http_client' | |
# Configurator for Guthub API client | |
# to register plugins after the builder is created | |
github_api.client_configurator: | |
class: AppBundle\Client\Github\ClientConfigurator | |
arguments: | |
- '@github_api.http_client_builder' | |
- ['@github_api.plugin.wait_and_retry', '@github_api.plugin.authentication'] | |
# Guthub API client | |
github_api.client: | |
class: Github\Client | |
arguments: | |
- '@github_api.http_client_builder' | |
configurator: ['@github_api.client_configurator', 'configure'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment