diff --git a/Makefile b/Makefile index 6c104c2..565f4dd 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ COMPOSER ?= $(RUN) composer t: terminal terminal: var ## Start a terminal inside the php container @$(if $(INSIDE_CONTAINER),echo 'Already inside docker container.'; exit 1,) - $(DOCKER_COMPOSE) run --rm $(ARGS) php bash + $(DOCKER_COMPOSE) run --rm $(ARGS) php sh .PHONY: t terminal run: ## Run a command using the php container: `make run CMD='php --version'` diff --git a/composer.json b/composer.json index f569c63..22acf32 100644 --- a/composer.json +++ b/composer.json @@ -20,10 +20,10 @@ "require": { "php": "^8.4", "amphp/amp": "^3.1", - "thesis/googleapis-rpc-types": "^0.2", - "thesis/grpc-client": "^0.2", - "thesis/grpc-protocol": "^0.2", - "thesis/grpc-server": "^0.2", + "thesis/googleapis-rpc-types": "^0.3", + "thesis/grpc-client": "^0.3", + "thesis/grpc-protocol": "^0.3", + "thesis/grpc-server": "^0.3", "thesis/protobuf": "^0.2", "thesis/protoregistry": "^0.1.2" }, @@ -33,12 +33,12 @@ }, "autoload": { "psr-4": { - "Grpc\\Reflection\\V1\\": "genproto/Grpc/Reflection/V1", - "Grpc\\Reflection\\V1alpha\\": "genproto/Grpc/Reflection/V1alpha", + "Thesis\\Grpc\\Reflection\\V1\\": "genproto/Thesis/Grpc/Reflection/V1", + "Thesis\\Grpc\\Reflection\\V1alpha\\": "genproto/Thesis/Grpc/Reflection/V1alpha", "Thesis\\Grpc\\Server\\Reflection\\": "src/" }, "files": [ - "genproto/Grpc/Reflection/autoload.metadata.php", + "genproto/Thesis/Grpc/Reflection/autoload.metadata.php", "src/register.php" ] }, diff --git a/genproto/Grpc/Reflection/V1/GrpcReflectionV1ReflectionDescriptorRegistry.php b/genproto/Grpc/Reflection/V1/GrpcReflectionV1ReflectionDescriptorRegistry.php deleted file mode 100644 index 523cd88..0000000 --- a/genproto/Grpc/Reflection/V1/GrpcReflectionV1ReflectionDescriptorRegistry.php +++ /dev/null @@ -1,51 +0,0 @@ -add(Registry\Descriptor::base64(self::DESCRIPTOR_BUFFER), new File( - name: 'grpc/reflection/v1/reflection.proto', - messages: [ - new File\MessageDescriptor('grpc.reflection.v1.ServerReflectionRequest', \Grpc\Reflection\V1\ServerReflectionRequest::class), - new File\MessageDescriptor('grpc.reflection.v1.ExtensionRequest', \Grpc\Reflection\V1\ExtensionRequest::class), - new File\MessageDescriptor('grpc.reflection.v1.ServerReflectionResponse', \Grpc\Reflection\V1\ServerReflectionResponse::class), - new File\MessageDescriptor('grpc.reflection.v1.FileDescriptorResponse', \Grpc\Reflection\V1\FileDescriptorResponse::class), - new File\MessageDescriptor('grpc.reflection.v1.ExtensionNumberResponse', \Grpc\Reflection\V1\ExtensionNumberResponse::class), - new File\MessageDescriptor('grpc.reflection.v1.ListServiceResponse', \Grpc\Reflection\V1\ListServiceResponse::class), - new File\MessageDescriptor('grpc.reflection.v1.ServiceResponse', \Grpc\Reflection\V1\ServiceResponse::class), - new File\MessageDescriptor('grpc.reflection.v1.ErrorResponse', \Grpc\Reflection\V1\ErrorResponse::class), - ], - services: [ - new File\ServiceDescriptor( - name: 'grpc.reflection.v1.ServerReflection', - methods: [ - new File\MethodDescriptor('ServerReflectionInfo', true, true), - ], - ), - ], - )); - } -} diff --git a/genproto/Grpc/Reflection/V1/ServerReflectionRequest.php b/genproto/Grpc/Reflection/V1/ServerReflectionRequest.php deleted file mode 100644 index e6daa25..0000000 --- a/genproto/Grpc/Reflection/V1/ServerReflectionRequest.php +++ /dev/null @@ -1,36 +0,0 @@ -add(Registry\Descriptor::base64(self::DESCRIPTOR_BUFFER), new File( - name: 'grpc/reflection/v1alpha/reflection.proto', - messages: [ - new File\MessageDescriptor('grpc.reflection.v1alpha.ServerReflectionRequest', \Grpc\Reflection\V1alpha\ServerReflectionRequest::class), - new File\MessageDescriptor('grpc.reflection.v1alpha.ExtensionRequest', \Grpc\Reflection\V1alpha\ExtensionRequest::class), - new File\MessageDescriptor('grpc.reflection.v1alpha.ServerReflectionResponse', \Grpc\Reflection\V1alpha\ServerReflectionResponse::class), - new File\MessageDescriptor('grpc.reflection.v1alpha.FileDescriptorResponse', \Grpc\Reflection\V1alpha\FileDescriptorResponse::class), - new File\MessageDescriptor('grpc.reflection.v1alpha.ExtensionNumberResponse', \Grpc\Reflection\V1alpha\ExtensionNumberResponse::class), - new File\MessageDescriptor('grpc.reflection.v1alpha.ListServiceResponse', \Grpc\Reflection\V1alpha\ListServiceResponse::class), - new File\MessageDescriptor('grpc.reflection.v1alpha.ServiceResponse', \Grpc\Reflection\V1alpha\ServiceResponse::class), - new File\MessageDescriptor('grpc.reflection.v1alpha.ErrorResponse', \Grpc\Reflection\V1alpha\ErrorResponse::class), - ], - services: [ - new File\ServiceDescriptor( - name: 'grpc.reflection.v1alpha.ServerReflection', - methods: [ - new File\MethodDescriptor('ServerReflectionInfo', true, true), - ], - ), - ], - )); - } -} diff --git a/genproto/Grpc/Reflection/V1alpha/ServerReflectionRequest.php b/genproto/Grpc/Reflection/V1alpha/ServerReflectionRequest.php deleted file mode 100644 index 0e9aea8..0000000 --- a/genproto/Grpc/Reflection/V1alpha/ServerReflectionRequest.php +++ /dev/null @@ -1,36 +0,0 @@ -register( - new \Thesis\Protobuf\Registry\OnceRegistrar(new \Grpc\Reflection\V1\DescriptorRegistry()), - new \Thesis\Protobuf\Registry\OnceRegistrar(new \Grpc\Reflection\V1alpha\DescriptorRegistry()), -); diff --git a/genproto/Grpc/Reflection/V1/DescriptorRegistry.php b/genproto/Thesis/Grpc/Reflection/V1/DescriptorRegistry.php similarity index 94% rename from genproto/Grpc/Reflection/V1/DescriptorRegistry.php rename to genproto/Thesis/Grpc/Reflection/V1/DescriptorRegistry.php index aaa744d..e80647a 100644 --- a/genproto/Grpc/Reflection/V1/DescriptorRegistry.php +++ b/genproto/Thesis/Grpc/Reflection/V1/DescriptorRegistry.php @@ -3,14 +3,14 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: grpc/reflection/v1/reflection.proto */ declare(strict_types=1); -namespace Grpc\Reflection\V1; +namespace Thesis\Grpc\Reflection\V1; use Override; use Thesis\Protobuf\Registry; @@ -29,14 +29,14 @@ public function register(Registry\Pool $pool): void $pool->add(Registry\Descriptor::base64(self::REFLECTION_DESCRIPTOR_BUFFER), new File( name: 'grpc/reflection/v1/reflection.proto', messages: [ - new File\MessageDescriptor('grpc.reflection.v1.ServerReflectionRequest', \Grpc\Reflection\V1\ServerReflectionRequest::class), - new File\MessageDescriptor('grpc.reflection.v1.ExtensionRequest', \Grpc\Reflection\V1\ExtensionRequest::class), - new File\MessageDescriptor('grpc.reflection.v1.ServerReflectionResponse', \Grpc\Reflection\V1\ServerReflectionResponse::class), - new File\MessageDescriptor('grpc.reflection.v1.FileDescriptorResponse', \Grpc\Reflection\V1\FileDescriptorResponse::class), - new File\MessageDescriptor('grpc.reflection.v1.ExtensionNumberResponse', \Grpc\Reflection\V1\ExtensionNumberResponse::class), - new File\MessageDescriptor('grpc.reflection.v1.ListServiceResponse', \Grpc\Reflection\V1\ListServiceResponse::class), - new File\MessageDescriptor('grpc.reflection.v1.ServiceResponse', \Grpc\Reflection\V1\ServiceResponse::class), - new File\MessageDescriptor('grpc.reflection.v1.ErrorResponse', \Grpc\Reflection\V1\ErrorResponse::class), + new File\MessageDescriptor('grpc.reflection.v1.ServerReflectionRequest', \Thesis\Grpc\Reflection\V1\ServerReflectionRequest::class), + new File\MessageDescriptor('grpc.reflection.v1.ExtensionRequest', \Thesis\Grpc\Reflection\V1\ExtensionRequest::class), + new File\MessageDescriptor('grpc.reflection.v1.ServerReflectionResponse', \Thesis\Grpc\Reflection\V1\ServerReflectionResponse::class), + new File\MessageDescriptor('grpc.reflection.v1.FileDescriptorResponse', \Thesis\Grpc\Reflection\V1\FileDescriptorResponse::class), + new File\MessageDescriptor('grpc.reflection.v1.ExtensionNumberResponse', \Thesis\Grpc\Reflection\V1\ExtensionNumberResponse::class), + new File\MessageDescriptor('grpc.reflection.v1.ListServiceResponse', \Thesis\Grpc\Reflection\V1\ListServiceResponse::class), + new File\MessageDescriptor('grpc.reflection.v1.ServiceResponse', \Thesis\Grpc\Reflection\V1\ServiceResponse::class), + new File\MessageDescriptor('grpc.reflection.v1.ErrorResponse', \Thesis\Grpc\Reflection\V1\ErrorResponse::class), ], services: [ new File\ServiceDescriptor( diff --git a/genproto/Grpc/Reflection/V1/ErrorResponse.php b/genproto/Thesis/Grpc/Reflection/V1/ErrorResponse.php similarity index 90% rename from genproto/Grpc/Reflection/V1/ErrorResponse.php rename to genproto/Thesis/Grpc/Reflection/V1/ErrorResponse.php index be34a76..bad6a65 100644 --- a/genproto/Grpc/Reflection/V1/ErrorResponse.php +++ b/genproto/Thesis/Grpc/Reflection/V1/ErrorResponse.php @@ -3,14 +3,14 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: grpc/reflection/v1/reflection.proto */ declare(strict_types=1); -namespace Grpc\Reflection\V1; +namespace Thesis\Grpc\Reflection\V1; use Thesis\Protobuf\Reflection; diff --git a/genproto/Grpc/Reflection/V1/ExtensionNumberResponse.php b/genproto/Thesis/Grpc/Reflection/V1/ExtensionNumberResponse.php similarity index 91% rename from genproto/Grpc/Reflection/V1/ExtensionNumberResponse.php rename to genproto/Thesis/Grpc/Reflection/V1/ExtensionNumberResponse.php index 429b5b0..7ea98cd 100644 --- a/genproto/Grpc/Reflection/V1/ExtensionNumberResponse.php +++ b/genproto/Thesis/Grpc/Reflection/V1/ExtensionNumberResponse.php @@ -3,14 +3,14 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: grpc/reflection/v1/reflection.proto */ declare(strict_types=1); -namespace Grpc\Reflection\V1; +namespace Thesis\Grpc\Reflection\V1; use Thesis\Protobuf\Reflection; diff --git a/genproto/Grpc/Reflection/V1/ExtensionRequest.php b/genproto/Thesis/Grpc/Reflection/V1/ExtensionRequest.php similarity index 90% rename from genproto/Grpc/Reflection/V1/ExtensionRequest.php rename to genproto/Thesis/Grpc/Reflection/V1/ExtensionRequest.php index 5f545af..4ec4350 100644 --- a/genproto/Grpc/Reflection/V1/ExtensionRequest.php +++ b/genproto/Thesis/Grpc/Reflection/V1/ExtensionRequest.php @@ -3,14 +3,14 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: grpc/reflection/v1/reflection.proto */ declare(strict_types=1); -namespace Grpc\Reflection\V1; +namespace Thesis\Grpc\Reflection\V1; use Thesis\Protobuf\Reflection; diff --git a/genproto/Grpc/Reflection/V1/FileDescriptorResponse.php b/genproto/Thesis/Grpc/Reflection/V1/FileDescriptorResponse.php similarity index 92% rename from genproto/Grpc/Reflection/V1/FileDescriptorResponse.php rename to genproto/Thesis/Grpc/Reflection/V1/FileDescriptorResponse.php index 3176ae2..924322d 100644 --- a/genproto/Grpc/Reflection/V1/FileDescriptorResponse.php +++ b/genproto/Thesis/Grpc/Reflection/V1/FileDescriptorResponse.php @@ -3,14 +3,14 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: grpc/reflection/v1/reflection.proto */ declare(strict_types=1); -namespace Grpc\Reflection\V1; +namespace Thesis\Grpc\Reflection\V1; use Thesis\Protobuf\Reflection; diff --git a/genproto/Grpc/Reflection/V1/ListServiceResponse.php b/genproto/Thesis/Grpc/Reflection/V1/ListServiceResponse.php similarity index 67% rename from genproto/Grpc/Reflection/V1/ListServiceResponse.php rename to genproto/Thesis/Grpc/Reflection/V1/ListServiceResponse.php index 9f78e4a..7b7b1aa 100644 --- a/genproto/Grpc/Reflection/V1/ListServiceResponse.php +++ b/genproto/Thesis/Grpc/Reflection/V1/ListServiceResponse.php @@ -3,14 +3,14 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: grpc/reflection/v1/reflection.proto */ declare(strict_types=1); -namespace Grpc\Reflection\V1; +namespace Thesis\Grpc\Reflection\V1; use Thesis\Protobuf\Reflection; @@ -22,11 +22,11 @@ final readonly class ListServiceResponse { /** - * @param list<\Grpc\Reflection\V1\ServiceResponse> $service The information of each service may be expanded in the future, so we use + * @param list<\Thesis\Grpc\Reflection\V1\ServiceResponse> $service The information of each service may be expanded in the future, so we use * ServiceResponse message to encapsulate it. */ public function __construct( - #[Reflection\Field(1, new Reflection\ListT(new Reflection\ObjectT(\Grpc\Reflection\V1\ServiceResponse::class)))] + #[Reflection\Field(1, new Reflection\ListT(new Reflection\ObjectT(\Thesis\Grpc\Reflection\V1\ServiceResponse::class)))] public array $service = [], ) {} } diff --git a/genproto/Grpc/Reflection/V1/ServerReflectionClient.php b/genproto/Thesis/Grpc/Reflection/V1/ServerReflectionClient.php similarity index 72% rename from genproto/Grpc/Reflection/V1/ServerReflectionClient.php rename to genproto/Thesis/Grpc/Reflection/V1/ServerReflectionClient.php index 7637944..0875829 100644 --- a/genproto/Grpc/Reflection/V1/ServerReflectionClient.php +++ b/genproto/Thesis/Grpc/Reflection/V1/ServerReflectionClient.php @@ -3,14 +3,14 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: grpc/reflection/v1/reflection.proto */ declare(strict_types=1); -namespace Grpc\Reflection\V1; +namespace Thesis\Grpc\Reflection\V1; use Amp\Cancellation; use Amp\NullCancellation; @@ -31,16 +31,16 @@ public function __construct( * The reflection service is structured as a bidirectional stream, ensuring * all related requests go to a single server. * - * @return Client\BidirectionalStreamChannel<\Grpc\Reflection\V1\ServerReflectionRequest, \Grpc\Reflection\V1\ServerReflectionResponse> + * @return Client\BidirectionalStreamChannel<\Thesis\Grpc\Reflection\V1\ServerReflectionRequest, \Thesis\Grpc\Reflection\V1\ServerReflectionResponse> */ public function serverReflectionInfo( Metadata $md = new Metadata(), Cancellation $cancellation = new NullCancellation(), ): Client\BidirectionalStreamChannel { - /** @var Client\Invoke<\Grpc\Reflection\V1\ServerReflectionRequest, \Grpc\Reflection\V1\ServerReflectionResponse> $invoke */ + /** @var Client\Invoke<\Thesis\Grpc\Reflection\V1\ServerReflectionRequest, \Thesis\Grpc\Reflection\V1\ServerReflectionResponse> $invoke */ $invoke = new Client\Invoke( method: '/grpc.reflection.v1.ServerReflection/ServerReflectionInfo', - output: \Grpc\Reflection\V1\ServerReflectionResponse::class, + output: \Thesis\Grpc\Reflection\V1\ServerReflectionResponse::class, type: Grpc\RpcType::BidirectionalStream, ); diff --git a/genproto/Thesis/Grpc/Reflection/V1/ServerReflectionRequest.php b/genproto/Thesis/Grpc/Reflection/V1/ServerReflectionRequest.php new file mode 100644 index 0000000..912d643 --- /dev/null +++ b/genproto/Thesis/Grpc/Reflection/V1/ServerReflectionRequest.php @@ -0,0 +1,36 @@ + $stream + * @param Server\BidirectionalStreamChannel<\Thesis\Grpc\Reflection\V1\ServerReflectionRequest, \Thesis\Grpc\Reflection\V1\ServerReflectionResponse> $stream */ public function serverReflectionInfo( Server\BidirectionalStreamChannel $stream, diff --git a/genproto/Grpc/Reflection/V1/ServerReflectionServerRegistry.php b/genproto/Thesis/Grpc/Reflection/V1/ServerReflectionServerRegistry.php similarity index 79% rename from genproto/Grpc/Reflection/V1/ServerReflectionServerRegistry.php rename to genproto/Thesis/Grpc/Reflection/V1/ServerReflectionServerRegistry.php index 4e83e75..71a1735 100644 --- a/genproto/Grpc/Reflection/V1/ServerReflectionServerRegistry.php +++ b/genproto/Thesis/Grpc/Reflection/V1/ServerReflectionServerRegistry.php @@ -3,14 +3,14 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: grpc/reflection/v1/reflection.proto */ declare(strict_types=1); -namespace Grpc\Reflection\V1; +namespace Thesis\Grpc\Reflection\V1; use Override; use Thesis\Grpc; @@ -22,7 +22,7 @@ final readonly class ServerReflectionServerRegistry implements Server\ServiceRegistry { public function __construct( - private \Grpc\Reflection\V1\ServerReflectionServer $server, + private \Thesis\Grpc\Reflection\V1\ServerReflectionServer $server, ) {} #[Override] @@ -30,7 +30,7 @@ public function services(): iterable { yield new Server\Service('grpc.reflection.v1.ServerReflection', [ new Server\Rpc( - handle: new Server\Handle('ServerReflectionInfo', \Grpc\Reflection\V1\ServerReflectionRequest::class), + handle: new Server\Handle('ServerReflectionInfo', \Thesis\Grpc\Reflection\V1\ServerReflectionRequest::class), handler: new Server\BidirectionalStreamHandler($this->server->serverReflectionInfo(...)), type: Grpc\RpcType::BidirectionalStream, ), diff --git a/genproto/Grpc/Reflection/V1/ServiceResponse.php b/genproto/Thesis/Grpc/Reflection/V1/ServiceResponse.php similarity index 90% rename from genproto/Grpc/Reflection/V1/ServiceResponse.php rename to genproto/Thesis/Grpc/Reflection/V1/ServiceResponse.php index 4491074..7b9749f 100644 --- a/genproto/Grpc/Reflection/V1/ServiceResponse.php +++ b/genproto/Thesis/Grpc/Reflection/V1/ServiceResponse.php @@ -3,14 +3,14 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: grpc/reflection/v1/reflection.proto */ declare(strict_types=1); -namespace Grpc\Reflection\V1; +namespace Thesis\Grpc\Reflection\V1; use Thesis\Protobuf\Reflection; diff --git a/genproto/Grpc/Reflection/V1alpha/DescriptorRegistry.php b/genproto/Thesis/Grpc/Reflection/V1alpha/DescriptorRegistry.php similarity index 93% rename from genproto/Grpc/Reflection/V1alpha/DescriptorRegistry.php rename to genproto/Thesis/Grpc/Reflection/V1alpha/DescriptorRegistry.php index a45cf24..beb0ef2 100644 --- a/genproto/Grpc/Reflection/V1alpha/DescriptorRegistry.php +++ b/genproto/Thesis/Grpc/Reflection/V1alpha/DescriptorRegistry.php @@ -3,14 +3,14 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: grpc/reflection/v1alpha/reflection.proto */ declare(strict_types=1); -namespace Grpc\Reflection\V1alpha; +namespace Thesis\Grpc\Reflection\V1alpha; use Override; use Thesis\Protobuf\Registry; @@ -29,14 +29,14 @@ public function register(Registry\Pool $pool): void $pool->add(Registry\Descriptor::base64(self::REFLECTION_DESCRIPTOR_BUFFER), new File( name: 'grpc/reflection/v1alpha/reflection.proto', messages: [ - new File\MessageDescriptor('grpc.reflection.v1alpha.ServerReflectionRequest', \Grpc\Reflection\V1alpha\ServerReflectionRequest::class), - new File\MessageDescriptor('grpc.reflection.v1alpha.ExtensionRequest', \Grpc\Reflection\V1alpha\ExtensionRequest::class), - new File\MessageDescriptor('grpc.reflection.v1alpha.ServerReflectionResponse', \Grpc\Reflection\V1alpha\ServerReflectionResponse::class), - new File\MessageDescriptor('grpc.reflection.v1alpha.FileDescriptorResponse', \Grpc\Reflection\V1alpha\FileDescriptorResponse::class), - new File\MessageDescriptor('grpc.reflection.v1alpha.ExtensionNumberResponse', \Grpc\Reflection\V1alpha\ExtensionNumberResponse::class), - new File\MessageDescriptor('grpc.reflection.v1alpha.ListServiceResponse', \Grpc\Reflection\V1alpha\ListServiceResponse::class), - new File\MessageDescriptor('grpc.reflection.v1alpha.ServiceResponse', \Grpc\Reflection\V1alpha\ServiceResponse::class), - new File\MessageDescriptor('grpc.reflection.v1alpha.ErrorResponse', \Grpc\Reflection\V1alpha\ErrorResponse::class), + new File\MessageDescriptor('grpc.reflection.v1alpha.ServerReflectionRequest', \Thesis\Grpc\Reflection\V1alpha\ServerReflectionRequest::class), + new File\MessageDescriptor('grpc.reflection.v1alpha.ExtensionRequest', \Thesis\Grpc\Reflection\V1alpha\ExtensionRequest::class), + new File\MessageDescriptor('grpc.reflection.v1alpha.ServerReflectionResponse', \Thesis\Grpc\Reflection\V1alpha\ServerReflectionResponse::class), + new File\MessageDescriptor('grpc.reflection.v1alpha.FileDescriptorResponse', \Thesis\Grpc\Reflection\V1alpha\FileDescriptorResponse::class), + new File\MessageDescriptor('grpc.reflection.v1alpha.ExtensionNumberResponse', \Thesis\Grpc\Reflection\V1alpha\ExtensionNumberResponse::class), + new File\MessageDescriptor('grpc.reflection.v1alpha.ListServiceResponse', \Thesis\Grpc\Reflection\V1alpha\ListServiceResponse::class), + new File\MessageDescriptor('grpc.reflection.v1alpha.ServiceResponse', \Thesis\Grpc\Reflection\V1alpha\ServiceResponse::class), + new File\MessageDescriptor('grpc.reflection.v1alpha.ErrorResponse', \Thesis\Grpc\Reflection\V1alpha\ErrorResponse::class), ], services: [ new File\ServiceDescriptor( diff --git a/genproto/Grpc/Reflection/V1alpha/ErrorResponse.php b/genproto/Thesis/Grpc/Reflection/V1alpha/ErrorResponse.php similarity index 89% rename from genproto/Grpc/Reflection/V1alpha/ErrorResponse.php rename to genproto/Thesis/Grpc/Reflection/V1alpha/ErrorResponse.php index 38f961f..19bcb7f 100644 --- a/genproto/Grpc/Reflection/V1alpha/ErrorResponse.php +++ b/genproto/Thesis/Grpc/Reflection/V1alpha/ErrorResponse.php @@ -3,14 +3,14 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: grpc/reflection/v1alpha/reflection.proto */ declare(strict_types=1); -namespace Grpc\Reflection\V1alpha; +namespace Thesis\Grpc\Reflection\V1alpha; use Thesis\Protobuf\Reflection; diff --git a/genproto/Grpc/Reflection/V1alpha/ExtensionNumberResponse.php b/genproto/Thesis/Grpc/Reflection/V1alpha/ExtensionNumberResponse.php similarity index 91% rename from genproto/Grpc/Reflection/V1alpha/ExtensionNumberResponse.php rename to genproto/Thesis/Grpc/Reflection/V1alpha/ExtensionNumberResponse.php index b979c14..fc993ce 100644 --- a/genproto/Grpc/Reflection/V1alpha/ExtensionNumberResponse.php +++ b/genproto/Thesis/Grpc/Reflection/V1alpha/ExtensionNumberResponse.php @@ -3,14 +3,14 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: grpc/reflection/v1alpha/reflection.proto */ declare(strict_types=1); -namespace Grpc\Reflection\V1alpha; +namespace Thesis\Grpc\Reflection\V1alpha; use Thesis\Protobuf\Reflection; diff --git a/genproto/Grpc/Reflection/V1alpha/ExtensionRequest.php b/genproto/Thesis/Grpc/Reflection/V1alpha/ExtensionRequest.php similarity index 90% rename from genproto/Grpc/Reflection/V1alpha/ExtensionRequest.php rename to genproto/Thesis/Grpc/Reflection/V1alpha/ExtensionRequest.php index 0125c6e..4a10d93 100644 --- a/genproto/Grpc/Reflection/V1alpha/ExtensionRequest.php +++ b/genproto/Thesis/Grpc/Reflection/V1alpha/ExtensionRequest.php @@ -3,14 +3,14 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: grpc/reflection/v1alpha/reflection.proto */ declare(strict_types=1); -namespace Grpc\Reflection\V1alpha; +namespace Thesis\Grpc\Reflection\V1alpha; use Thesis\Protobuf\Reflection; diff --git a/genproto/Grpc/Reflection/V1alpha/FileDescriptorResponse.php b/genproto/Thesis/Grpc/Reflection/V1alpha/FileDescriptorResponse.php similarity index 91% rename from genproto/Grpc/Reflection/V1alpha/FileDescriptorResponse.php rename to genproto/Thesis/Grpc/Reflection/V1alpha/FileDescriptorResponse.php index 297d02f..bef2877 100644 --- a/genproto/Grpc/Reflection/V1alpha/FileDescriptorResponse.php +++ b/genproto/Thesis/Grpc/Reflection/V1alpha/FileDescriptorResponse.php @@ -3,14 +3,14 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: grpc/reflection/v1alpha/reflection.proto */ declare(strict_types=1); -namespace Grpc\Reflection\V1alpha; +namespace Thesis\Grpc\Reflection\V1alpha; use Thesis\Protobuf\Reflection; diff --git a/genproto/Grpc/Reflection/V1alpha/ListServiceResponse.php b/genproto/Thesis/Grpc/Reflection/V1alpha/ListServiceResponse.php similarity index 66% rename from genproto/Grpc/Reflection/V1alpha/ListServiceResponse.php rename to genproto/Thesis/Grpc/Reflection/V1alpha/ListServiceResponse.php index fa6cb74..0a45e58 100644 --- a/genproto/Grpc/Reflection/V1alpha/ListServiceResponse.php +++ b/genproto/Thesis/Grpc/Reflection/V1alpha/ListServiceResponse.php @@ -3,14 +3,14 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: grpc/reflection/v1alpha/reflection.proto */ declare(strict_types=1); -namespace Grpc\Reflection\V1alpha; +namespace Thesis\Grpc\Reflection\V1alpha; use Thesis\Protobuf\Reflection; @@ -22,11 +22,11 @@ final readonly class ListServiceResponse { /** - * @param list<\Grpc\Reflection\V1alpha\ServiceResponse> $service The information of each service may be expanded in the future, so we use + * @param list<\Thesis\Grpc\Reflection\V1alpha\ServiceResponse> $service The information of each service may be expanded in the future, so we use * ServiceResponse message to encapsulate it. */ public function __construct( - #[Reflection\Field(1, new Reflection\ListT(new Reflection\ObjectT(\Grpc\Reflection\V1alpha\ServiceResponse::class)))] + #[Reflection\Field(1, new Reflection\ListT(new Reflection\ObjectT(\Thesis\Grpc\Reflection\V1alpha\ServiceResponse::class)))] public array $service = [], ) {} } diff --git a/genproto/Grpc/Reflection/V1alpha/ServerReflectionClient.php b/genproto/Thesis/Grpc/Reflection/V1alpha/ServerReflectionClient.php similarity index 71% rename from genproto/Grpc/Reflection/V1alpha/ServerReflectionClient.php rename to genproto/Thesis/Grpc/Reflection/V1alpha/ServerReflectionClient.php index 54f3926..c801e77 100644 --- a/genproto/Grpc/Reflection/V1alpha/ServerReflectionClient.php +++ b/genproto/Thesis/Grpc/Reflection/V1alpha/ServerReflectionClient.php @@ -3,14 +3,14 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: grpc/reflection/v1alpha/reflection.proto */ declare(strict_types=1); -namespace Grpc\Reflection\V1alpha; +namespace Thesis\Grpc\Reflection\V1alpha; use Amp\Cancellation; use Amp\NullCancellation; @@ -31,16 +31,16 @@ public function __construct( * The reflection service is structured as a bidirectional stream, ensuring * all related requests go to a single server. * - * @return Client\BidirectionalStreamChannel<\Grpc\Reflection\V1alpha\ServerReflectionRequest, \Grpc\Reflection\V1alpha\ServerReflectionResponse> + * @return Client\BidirectionalStreamChannel<\Thesis\Grpc\Reflection\V1alpha\ServerReflectionRequest, \Thesis\Grpc\Reflection\V1alpha\ServerReflectionResponse> */ public function serverReflectionInfo( Metadata $md = new Metadata(), Cancellation $cancellation = new NullCancellation(), ): Client\BidirectionalStreamChannel { - /** @var Client\Invoke<\Grpc\Reflection\V1alpha\ServerReflectionRequest, \Grpc\Reflection\V1alpha\ServerReflectionResponse> $invoke */ + /** @var Client\Invoke<\Thesis\Grpc\Reflection\V1alpha\ServerReflectionRequest, \Thesis\Grpc\Reflection\V1alpha\ServerReflectionResponse> $invoke */ $invoke = new Client\Invoke( method: '/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo', - output: \Grpc\Reflection\V1alpha\ServerReflectionResponse::class, + output: \Thesis\Grpc\Reflection\V1alpha\ServerReflectionResponse::class, type: Grpc\RpcType::BidirectionalStream, ); diff --git a/genproto/Thesis/Grpc/Reflection/V1alpha/ServerReflectionRequest.php b/genproto/Thesis/Grpc/Reflection/V1alpha/ServerReflectionRequest.php new file mode 100644 index 0000000..a021775 --- /dev/null +++ b/genproto/Thesis/Grpc/Reflection/V1alpha/ServerReflectionRequest.php @@ -0,0 +1,36 @@ + $stream + * @param Server\BidirectionalStreamChannel<\Thesis\Grpc\Reflection\V1alpha\ServerReflectionRequest, \Thesis\Grpc\Reflection\V1alpha\ServerReflectionResponse> $stream */ public function serverReflectionInfo( Server\BidirectionalStreamChannel $stream, diff --git a/genproto/Grpc/Reflection/V1alpha/ServerReflectionServerRegistry.php b/genproto/Thesis/Grpc/Reflection/V1alpha/ServerReflectionServerRegistry.php similarity index 78% rename from genproto/Grpc/Reflection/V1alpha/ServerReflectionServerRegistry.php rename to genproto/Thesis/Grpc/Reflection/V1alpha/ServerReflectionServerRegistry.php index b97ba1a..f51c9ff 100644 --- a/genproto/Grpc/Reflection/V1alpha/ServerReflectionServerRegistry.php +++ b/genproto/Thesis/Grpc/Reflection/V1alpha/ServerReflectionServerRegistry.php @@ -3,14 +3,14 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: grpc/reflection/v1alpha/reflection.proto */ declare(strict_types=1); -namespace Grpc\Reflection\V1alpha; +namespace Thesis\Grpc\Reflection\V1alpha; use Override; use Thesis\Grpc; @@ -22,7 +22,7 @@ final readonly class ServerReflectionServerRegistry implements Server\ServiceRegistry { public function __construct( - private \Grpc\Reflection\V1alpha\ServerReflectionServer $server, + private \Thesis\Grpc\Reflection\V1alpha\ServerReflectionServer $server, ) {} #[Override] @@ -30,7 +30,7 @@ public function services(): iterable { yield new Server\Service('grpc.reflection.v1alpha.ServerReflection', [ new Server\Rpc( - handle: new Server\Handle('ServerReflectionInfo', \Grpc\Reflection\V1alpha\ServerReflectionRequest::class), + handle: new Server\Handle('ServerReflectionInfo', \Thesis\Grpc\Reflection\V1alpha\ServerReflectionRequest::class), handler: new Server\BidirectionalStreamHandler($this->server->serverReflectionInfo(...)), type: Grpc\RpcType::BidirectionalStream, ), diff --git a/genproto/Grpc/Reflection/V1alpha/ServiceResponse.php b/genproto/Thesis/Grpc/Reflection/V1alpha/ServiceResponse.php similarity index 89% rename from genproto/Grpc/Reflection/V1alpha/ServiceResponse.php rename to genproto/Thesis/Grpc/Reflection/V1alpha/ServiceResponse.php index a83345d..51fddac 100644 --- a/genproto/Grpc/Reflection/V1alpha/ServiceResponse.php +++ b/genproto/Thesis/Grpc/Reflection/V1alpha/ServiceResponse.php @@ -3,14 +3,14 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: grpc/reflection/v1alpha/reflection.proto */ declare(strict_types=1); -namespace Grpc\Reflection\V1alpha; +namespace Thesis\Grpc\Reflection\V1alpha; use Thesis\Protobuf\Reflection; diff --git a/genproto/Thesis/Grpc/Reflection/autoload.metadata.php b/genproto/Thesis/Grpc/Reflection/autoload.metadata.php new file mode 100644 index 0000000..7633ee1 --- /dev/null +++ b/genproto/Thesis/Grpc/Reflection/autoload.metadata.php @@ -0,0 +1,15 @@ +register( + new \Thesis\Protobuf\Registry\OnceRegistrar(new \Thesis\Grpc\Reflection\V1\DescriptorRegistry()), + new \Thesis\Protobuf\Registry\OnceRegistrar(new \Thesis\Grpc\Reflection\V1alpha\DescriptorRegistry()), +); diff --git a/src/Internal/AdaptV1AlphaBidirectionalStreamChannel.php b/src/Internal/AdaptV1AlphaBidirectionalStreamChannel.php index 8e1639a..ab11521 100644 --- a/src/Internal/AdaptV1AlphaBidirectionalStreamChannel.php +++ b/src/Internal/AdaptV1AlphaBidirectionalStreamChannel.php @@ -4,9 +4,9 @@ namespace Thesis\Grpc\Server\Reflection\Internal; -use Grpc\Reflection\V1; -use Grpc\Reflection\V1alpha; use Thesis\Grpc\Metadata; +use Thesis\Grpc\Reflection\V1; +use Thesis\Grpc\Reflection\V1alpha; use Thesis\Grpc\Server\BidirectionalStreamChannel; use Thesis\Grpc\ServerStream; diff --git a/src/Server.php b/src/Server.php index 665f32b..0a318a1 100644 --- a/src/Server.php +++ b/src/Server.php @@ -5,11 +5,11 @@ namespace Thesis\Grpc\Server\Reflection; use Amp\Cancellation; -use Google\Rpc\Code; -use Grpc\Reflection\V1; -use Grpc\Reflection\V1\ServerReflectionRequest; -use Grpc\Reflection\V1\ServerReflectionResponse; +use Thesis\Google\Rpc\Code; use Thesis\Grpc; +use Thesis\Grpc\Reflection\V1; +use Thesis\Grpc\Reflection\V1\ServerReflectionRequest; +use Thesis\Grpc\Reflection\V1\ServerReflectionResponse; use Thesis\Grpc\Server\BidirectionalStreamChannel; use Thesis\Protobuf; diff --git a/src/ServerV1Alpha.php b/src/ServerV1Alpha.php index 32fcf71..f9160b8 100644 --- a/src/ServerV1Alpha.php +++ b/src/ServerV1Alpha.php @@ -5,8 +5,8 @@ namespace Thesis\Grpc\Server\Reflection; use Amp\Cancellation; -use Grpc\Reflection\V1alpha; use Thesis\Grpc; +use Thesis\Grpc\Reflection\V1alpha; use Thesis\Grpc\Server\BidirectionalStreamChannel; /** diff --git a/src/register.php b/src/register.php index 57f95d0..c344fa1 100644 --- a/src/register.php +++ b/src/register.php @@ -4,8 +4,8 @@ namespace Thesis\Grpc\Server\Reflection; -use Grpc\Reflection\V1; -use Grpc\Reflection\V1alpha; +use Thesis\Grpc\Reflection\V1; +use Thesis\Grpc\Reflection\V1alpha; use Thesis\Grpc\Server\ServerRunning; use Thesis\Grpc\ServiceRegistrar; diff --git a/tests/ServerTest.php b/tests/ServerTest.php index 9650953..28e97a3 100644 --- a/tests/ServerTest.php +++ b/tests/ServerTest.php @@ -9,16 +9,16 @@ use Echos\Api\V1\EchoResponse; use Echos\Api\V1\EchoServiceServer; use Echos\Api\V1\EchoServiceServerRegistry; -use Google\Rpc\Code; -use Grpc\Reflection\V1\ExtensionRequest; -use Grpc\Reflection\V1\ServerReflectionClient; -use Grpc\Reflection\V1\ServerReflectionRequest; -use Grpc\Reflection\V1\ServerReflectionResponse; -use Grpc\Reflection\V1\ServiceResponse; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; +use Thesis\Google\Rpc\Code; use Thesis\Grpc\Client; use Thesis\Grpc\Metadata; +use Thesis\Grpc\Reflection\V1\ExtensionRequest; +use Thesis\Grpc\Reflection\V1\ServerReflectionClient; +use Thesis\Grpc\Reflection\V1\ServerReflectionRequest; +use Thesis\Grpc\Reflection\V1\ServerReflectionResponse; +use Thesis\Grpc\Reflection\V1\ServiceResponse; use Thesis\Grpc\Server; use Thesis\Protobuf\Registry\Pool; diff --git a/tests/ServerV1AlphaTest.php b/tests/ServerV1AlphaTest.php index 15790b4..3bd2783 100644 --- a/tests/ServerV1AlphaTest.php +++ b/tests/ServerV1AlphaTest.php @@ -9,13 +9,13 @@ use Echos\Api\V1\EchoResponse; use Echos\Api\V1\EchoServiceServer; use Echos\Api\V1\EchoServiceServerRegistry; -use Google\Rpc\Code; -use Grpc\Reflection\V1; -use Grpc\Reflection\V1alpha; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\TestCase; +use Thesis\Google\Rpc\Code; use Thesis\Grpc\Client; use Thesis\Grpc\Metadata; +use Thesis\Grpc\Reflection\V1; +use Thesis\Grpc\Reflection\V1alpha; use Thesis\Grpc\Server; use Thesis\Protobuf\Registry\Pool; diff --git a/tests/genproto/Echos/Api/V1/DescriptorRegistry.php b/tests/genproto/Echos/Api/V1/DescriptorRegistry.php index 9a952df..06eb4b1 100644 --- a/tests/genproto/Echos/Api/V1/DescriptorRegistry.php +++ b/tests/genproto/Echos/Api/V1/DescriptorRegistry.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: tests/protos/echo_v1.proto */ diff --git a/tests/genproto/Echos/Api/V1/EchoRequest.php b/tests/genproto/Echos/Api/V1/EchoRequest.php index fccfe4e..7b749c7 100644 --- a/tests/genproto/Echos/Api/V1/EchoRequest.php +++ b/tests/genproto/Echos/Api/V1/EchoRequest.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: tests/protos/echo_v1.proto */ diff --git a/tests/genproto/Echos/Api/V1/EchoResponse.php b/tests/genproto/Echos/Api/V1/EchoResponse.php index 55abd01..580262c 100644 --- a/tests/genproto/Echos/Api/V1/EchoResponse.php +++ b/tests/genproto/Echos/Api/V1/EchoResponse.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: tests/protos/echo_v1.proto */ diff --git a/tests/genproto/Echos/Api/V1/EchoServiceClient.php b/tests/genproto/Echos/Api/V1/EchoServiceClient.php index 97a15a4..12bdcc7 100644 --- a/tests/genproto/Echos/Api/V1/EchoServiceClient.php +++ b/tests/genproto/Echos/Api/V1/EchoServiceClient.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: tests/protos/echo_v1.proto */ diff --git a/tests/genproto/Echos/Api/V1/EchoServiceServer.php b/tests/genproto/Echos/Api/V1/EchoServiceServer.php index c7e896c..ee67c85 100644 --- a/tests/genproto/Echos/Api/V1/EchoServiceServer.php +++ b/tests/genproto/Echos/Api/V1/EchoServiceServer.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: tests/protos/echo_v1.proto */ diff --git a/tests/genproto/Echos/Api/V1/EchoServiceServerRegistry.php b/tests/genproto/Echos/Api/V1/EchoServiceServerRegistry.php index e18e3af..b0dfccf 100644 --- a/tests/genproto/Echos/Api/V1/EchoServiceServerRegistry.php +++ b/tests/genproto/Echos/Api/V1/EchoServiceServerRegistry.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 * Source: tests/protos/echo_v1.proto */ diff --git a/tests/genproto/Echos/Api/V1/autoload.metadata.php b/tests/genproto/Echos/Api/V1/autoload.metadata.php index abfbdb8..519855d 100644 --- a/tests/genproto/Echos/Api/V1/autoload.metadata.php +++ b/tests/genproto/Echos/Api/V1/autoload.metadata.php @@ -3,7 +3,7 @@ /** * Code generated by thesis/protoc-plugin. DO NOT EDIT. * Versions: - * thesis/protoc-plugin — v0.4.2 + * thesis/protoc-plugin — v0.6.1 * protoc — v6.33.5 */