diff --git a/installer/config.php b/installer/config.php index 814633ff..ef2d87cd 100644 --- a/installer/config.php +++ b/installer/config.php @@ -54,6 +54,9 @@ 'hyperf/tracer' => [ 'version' => '~1.0.0', ], + 'hyperf/service-governance' => [ + 'version' => '~1.0.0', + ], ], 'require-dev' => [ ], @@ -65,17 +68,30 @@ 'custom-package' => true, 'options' => [ 1 => [ - 'name' => 'JSON-RPC', + 'name' => 'JSON-RPC with Service Governance', 'packages' => [ 'hyperf/json-rpc', 'hyperf/rpc', 'hyperf/rpc-client', 'hyperf/rpc-server', + 'hyperf/service-governance', ], 'resources' => [ ], ], 2 => [ + 'name' => 'JSON-RPC', + 'packages' => [ + 'hyperf/json-rpc', + 'hyperf/rpc', + 'hyperf/rpc-client', + 'hyperf/rpc-server', + ], + 'resources' => [ + 'resources/jsonrpc/services.php' => 'config/autoload/services.php', + ], + ], + 3 => [ 'name' => 'gRPC', 'packages' => [ 'hyperf/grpc-client', diff --git a/installer/resources/jsonrpc/services.php b/installer/resources/jsonrpc/services.php new file mode 100644 index 00000000..37387851 --- /dev/null +++ b/installer/resources/jsonrpc/services.php @@ -0,0 +1,19 @@ + [ + [ + // The service name, this name should as same as with the name of service provider. + 'name' => 'YourServiceName', + // The service registry, if `nodes` is missing below, then you should provide this configs. + 'registry' => [ + 'protocol' => 'consul', + 'address' => 'Enter the address of service registry', + ], + // If `registry` is missing, then you should provide the nodes configs. + 'nodes' => [ + // Provide the host and port of the service provider. + // ['host' => 'The host of the service provider', 'port' => 9502] + ], + ], + ], +]; \ No newline at end of file