services.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. return [
  12. 'enable' => [
  13. 'discovery' => true,
  14. 'register' => true,
  15. ],
  16. 'consumers' => [],
  17. 'providers' => [],
  18. 'drivers' => [
  19. 'consul' => [
  20. 'uri' => 'http://127.0.0.1:8500',
  21. 'token' => '',
  22. 'check' => [
  23. 'deregister_critical_service_after' => '90m',
  24. 'interval' => '1s',
  25. ],
  26. ],
  27. 'nacos' => [
  28. // nacos server url like https://nacos.hyperf.io, Priority is higher than host:port
  29. // 'url' => '',
  30. // The nacos host info
  31. 'host' => '127.0.0.1',
  32. 'port' => 8848,
  33. // The nacos account info
  34. 'username' => null,
  35. 'password' => null,
  36. 'guzzle' => [
  37. 'config' => null,
  38. ],
  39. 'group_name' => 'api',
  40. 'namespace_id' => 'namespace_id',
  41. 'heartbeat' => 5,
  42. 'ephemeral' => true,
  43. 'cluster' => 'DEFAULT',
  44. // Only support for nacos v2.
  45. 'grpc' => [
  46. 'enable' => false,
  47. 'heartbeat' => 10,
  48. ],
  49. ],
  50. ],
  51. ];