浏览代码

:fire: remove grpc support

Jeremy Zheng 2 年之前
父节点
当前提交
6084f2765c

二进制
rpc/morus/morus/GPBMetadata/Morus.php


+ 0 - 34
rpc/morus/morus/Mint/Morus/V1/MarkdownClient.php

@@ -1,34 +0,0 @@
-<?php
-// GENERATED CODE -- DO NOT EDIT!
-
-namespace Mint\Morus\V1;
-
-/**
- * ----------------------------------------------------------------------------
- */
-class MarkdownClient extends \Grpc\BaseStub {
-
-    /**
-     * @param string $hostname hostname
-     * @param array $opts channel options
-     * @param \Grpc\Channel $channel (optional) re-use channel object
-     */
-    public function __construct($hostname, $opts, $channel = null) {
-        parent::__construct($hostname, $opts, $channel);
-    }
-
-    /**
-     * @param \Mint\Morus\V1\MarkdownToHtmlRequest $argument input argument
-     * @param array $metadata metadata
-     * @param array $options call options
-     * @return \Grpc\UnaryCall
-     */
-    public function ToHtml(\Mint\Morus\V1\MarkdownToHtmlRequest $argument,
-      $metadata = [], $options = []) {
-        return $this->_simpleRequest('/mint.morus.v1.Markdown/ToHtml',
-        $argument,
-        ['\Mint\Morus\V1\MarkdownToHtmlResponse', 'decode'],
-        $metadata, $options);
-    }
-
-}

+ 0 - 42
rpc/morus/morus/Mint/Morus/V1/MarkdownStub.php

@@ -1,42 +0,0 @@
-<?php
-// GENERATED CODE -- DO NOT EDIT!
-
-namespace Mint\Morus\V1;
-
-/**
- * ----------------------------------------------------------------------------
- */
-class MarkdownStub {
-
-    /**
-     * @param \Mint\Morus\V1\MarkdownToHtmlRequest $request client request
-     * @param \Grpc\ServerContext $context server request context
-     * @return \Mint\Morus\V1\MarkdownToHtmlResponse for response data, null if if error occured
-     *     initial metadata (if any) and status (if not ok) should be set to $context
-     */
-    public function ToHtml(
-        \Mint\Morus\V1\MarkdownToHtmlRequest $request,
-        \Grpc\ServerContext $context
-    ): ?\Mint\Morus\V1\MarkdownToHtmlResponse {
-        $context->setStatus(\Grpc\Status::unimplemented());
-        return null;
-    }
-
-    /**
-     * Get the method descriptors of the service for server registration
-     *
-     * @return array of \Grpc\MethodDescriptor for the service methods
-     */
-    public final function getMethodDescriptors(): array
-    {
-        return [
-            '/mint.morus.v1.Markdown/ToHtml' => new \Grpc\MethodDescriptor(
-                $this,
-                'ToHtml',
-                '\Mint\Morus\V1\MarkdownToHtmlRequest',
-                \Grpc\MethodDescriptor::UNARY_CALL
-            ),
-        ];
-    }
-
-}

+ 0 - 85
rpc/morus/morus/Mint/Morus/V1/MarkdownToHtmlRequest.php

@@ -1,85 +0,0 @@
-<?php
-# Generated by the protocol buffer compiler.  DO NOT EDIT!
-# source: morus.proto
-
-namespace Mint\Morus\V1;
-
-use Google\Protobuf\Internal\GPBType;
-use Google\Protobuf\Internal\RepeatedField;
-use Google\Protobuf\Internal\GPBUtil;
-
-/**
- * Generated from protobuf message <code>mint.morus.v1.MarkdownToHtmlRequest</code>
- */
-class MarkdownToHtmlRequest extends \Google\Protobuf\Internal\Message
-{
-    /**
-     * Generated from protobuf field <code>string payload = 1;</code>
-     */
-    protected $payload = '';
-    /**
-     * Generated from protobuf field <code>bool sanitize = 2;</code>
-     */
-    protected $sanitize = false;
-
-    /**
-     * Constructor.
-     *
-     * @param array $data {
-     *     Optional. Data for populating the Message object.
-     *
-     *     @type string $payload
-     *     @type bool $sanitize
-     * }
-     */
-    public function __construct($data = NULL) {
-        \GPBMetadata\Morus::initOnce();
-        parent::__construct($data);
-    }
-
-    /**
-     * Generated from protobuf field <code>string payload = 1;</code>
-     * @return string
-     */
-    public function getPayload()
-    {
-        return $this->payload;
-    }
-
-    /**
-     * Generated from protobuf field <code>string payload = 1;</code>
-     * @param string $var
-     * @return $this
-     */
-    public function setPayload($var)
-    {
-        GPBUtil::checkString($var, True);
-        $this->payload = $var;
-
-        return $this;
-    }
-
-    /**
-     * Generated from protobuf field <code>bool sanitize = 2;</code>
-     * @return bool
-     */
-    public function getSanitize()
-    {
-        return $this->sanitize;
-    }
-
-    /**
-     * Generated from protobuf field <code>bool sanitize = 2;</code>
-     * @param bool $var
-     * @return $this
-     */
-    public function setSanitize($var)
-    {
-        GPBUtil::checkBool($var);
-        $this->sanitize = $var;
-
-        return $this;
-    }
-
-}
-

+ 0 - 58
rpc/morus/morus/Mint/Morus/V1/MarkdownToHtmlResponse.php

@@ -1,58 +0,0 @@
-<?php
-# Generated by the protocol buffer compiler.  DO NOT EDIT!
-# source: morus.proto
-
-namespace Mint\Morus\V1;
-
-use Google\Protobuf\Internal\GPBType;
-use Google\Protobuf\Internal\RepeatedField;
-use Google\Protobuf\Internal\GPBUtil;
-
-/**
- * Generated from protobuf message <code>mint.morus.v1.MarkdownToHtmlResponse</code>
- */
-class MarkdownToHtmlResponse extends \Google\Protobuf\Internal\Message
-{
-    /**
-     * Generated from protobuf field <code>string payload = 1;</code>
-     */
-    protected $payload = '';
-
-    /**
-     * Constructor.
-     *
-     * @param array $data {
-     *     Optional. Data for populating the Message object.
-     *
-     *     @type string $payload
-     * }
-     */
-    public function __construct($data = NULL) {
-        \GPBMetadata\Morus::initOnce();
-        parent::__construct($data);
-    }
-
-    /**
-     * Generated from protobuf field <code>string payload = 1;</code>
-     * @return string
-     */
-    public function getPayload()
-    {
-        return $this->payload;
-    }
-
-    /**
-     * Generated from protobuf field <code>string payload = 1;</code>
-     * @param string $var
-     * @return $this
-     */
-    public function setPayload($var)
-    {
-        GPBUtil::checkString($var, True);
-        $this->payload = $var;
-
-        return $this;
-    }
-
-}
-

+ 0 - 10
rpc/morus/morus/composer.json

@@ -1,15 +1,5 @@
 {
   "require": {
-    "grpc/grpc": "v1.57.0",
-    "google/protobuf": "v3.23.2",
     "erusev/parsedown": "^1.7"
-  },
-  "autoload": {
-    "psr-4": {
-      "GPBMetadata\\": [
-        "GPBMetadata/"
-      ],
-      "Mint\\": "Mint/"
-    }
   }
 }

+ 0 - 31
rpc/morus/morus/server.php

@@ -1,31 +0,0 @@
-<?php
-
-require dirname(__FILE__) . '/vendor/autoload.php';
-
-class Greeter extends \Mint\Morus\V1\MarkdownStub
-{
-    public function ToHtml(
-        \Mint\Morus\V1\MarkdownToHtmlRequest $request,
-        \Grpc\ServerContext $context
-    ): ?\Mint\Morus\V1\MarkdownToHtmlResponse {
-        $text = $request->getPayload();
-        //echo 'Received request: ' . $text . PHP_EOL;
-        $response = new \Mint\Morus\V1\MarkdownToHtmlResponse();
-        $Parsedown = new Parsedown();
-        $response->setPayload($Parsedown->text($text));
-        return $response;
-    }
-}
-
-$param = getopt('p:');
-
-if(!isset($param['p'])){
-    echo 'parameter port is required. -p 9999  ';
-    return;
-}
-$port = $param['p'];
-$server = new \Grpc\RpcServer();
-$server->addHttp2Port('0.0.0.0:' . $port);
-$server->handle(new Greeter());
-echo 'Listening on port :' . $port . PHP_EOL;
-$server->run();