├── .gitignore ├── LICENSE ├── README.md ├── composer.json ├── examples ├── etcd │ ├── put.php │ ├── put_double.php │ ├── share_client.php │ ├── stress.php │ └── watch.php ├── grpc │ ├── greeter_client.php │ ├── greeter_server.php │ ├── greeter_unix_client.php │ ├── greeter_unix_server.php │ └── helloworld │ │ ├── .gitignore │ │ ├── greeter_client.go │ │ ├── greeter_client.js │ │ ├── greeter_server.go │ │ └── greeter_server.js └── protos │ └── helloworld.proto ├── src ├── Etcd │ ├── Authpb │ │ ├── Permission.php │ │ ├── Permission │ │ │ └── Type.php │ │ ├── Permission_Type.php │ │ ├── Role.php │ │ └── User.php │ ├── Etcdserverpb │ │ ├── AlarmMember.php │ │ ├── AlarmRequest.php │ │ ├── AlarmRequest │ │ │ └── AlarmAction.php │ │ ├── AlarmRequest_AlarmAction.php │ │ ├── AlarmResponse.php │ │ ├── AlarmType.php │ │ ├── AuthClient.php │ │ ├── AuthDisableRequest.php │ │ ├── AuthDisableResponse.php │ │ ├── AuthEnableRequest.php │ │ ├── AuthEnableResponse.php │ │ ├── AuthRoleAddRequest.php │ │ ├── AuthRoleAddResponse.php │ │ ├── AuthRoleDeleteRequest.php │ │ ├── AuthRoleDeleteResponse.php │ │ ├── AuthRoleGetRequest.php │ │ ├── AuthRoleGetResponse.php │ │ ├── AuthRoleGrantPermissionRequest.php │ │ ├── AuthRoleGrantPermissionResponse.php │ │ ├── AuthRoleListRequest.php │ │ ├── AuthRoleListResponse.php │ │ ├── AuthRoleRevokePermissionRequest.php │ │ ├── AuthRoleRevokePermissionResponse.php │ │ ├── AuthUserAddRequest.php │ │ ├── AuthUserAddResponse.php │ │ ├── AuthUserChangePasswordRequest.php │ │ ├── AuthUserChangePasswordResponse.php │ │ ├── AuthUserDeleteRequest.php │ │ ├── AuthUserDeleteResponse.php │ │ ├── AuthUserGetRequest.php │ │ ├── AuthUserGetResponse.php │ │ ├── AuthUserGrantRoleRequest.php │ │ ├── AuthUserGrantRoleResponse.php │ │ ├── AuthUserListRequest.php │ │ ├── AuthUserListResponse.php │ │ ├── AuthUserRevokeRoleRequest.php │ │ ├── AuthUserRevokeRoleResponse.php │ │ ├── AuthenticateRequest.php │ │ ├── AuthenticateResponse.php │ │ ├── ClusterClient.php │ │ ├── CompactionRequest.php │ │ ├── CompactionResponse.php │ │ ├── Compare.php │ │ ├── Compare │ │ │ ├── CompareResult.php │ │ │ └── CompareTarget.php │ │ ├── Compare_CompareResult.php │ │ ├── Compare_CompareTarget.php │ │ ├── DefragmentRequest.php │ │ ├── DefragmentResponse.php │ │ ├── DeleteRangeRequest.php │ │ ├── DeleteRangeResponse.php │ │ ├── HashKVRequest.php │ │ ├── HashKVResponse.php │ │ ├── HashRequest.php │ │ ├── HashResponse.php │ │ ├── KVClient.php │ │ ├── LeaseCheckpoint.php │ │ ├── LeaseCheckpointRequest.php │ │ ├── LeaseCheckpointResponse.php │ │ ├── LeaseClient.php │ │ ├── LeaseGrantRequest.php │ │ ├── LeaseGrantResponse.php │ │ ├── LeaseKeepAliveRequest.php │ │ ├── LeaseKeepAliveResponse.php │ │ ├── LeaseLeasesRequest.php │ │ ├── LeaseLeasesResponse.php │ │ ├── LeaseRevokeRequest.php │ │ ├── LeaseRevokeResponse.php │ │ ├── LeaseStatus.php │ │ ├── LeaseTimeToLiveRequest.php │ │ ├── LeaseTimeToLiveResponse.php │ │ ├── MaintenanceClient.php │ │ ├── Member.php │ │ ├── MemberAddRequest.php │ │ ├── MemberAddResponse.php │ │ ├── MemberListRequest.php │ │ ├── MemberListResponse.php │ │ ├── MemberRemoveRequest.php │ │ ├── MemberRemoveResponse.php │ │ ├── MemberUpdateRequest.php │ │ ├── MemberUpdateResponse.php │ │ ├── MoveLeaderRequest.php │ │ ├── MoveLeaderResponse.php │ │ ├── PutRequest.php │ │ ├── PutResponse.php │ │ ├── RangeRequest.php │ │ ├── RangeRequest │ │ │ ├── SortOrder.php │ │ │ └── SortTarget.php │ │ ├── RangeRequest_SortOrder.php │ │ ├── RangeRequest_SortTarget.php │ │ ├── RangeResponse.php │ │ ├── RequestOp.php │ │ ├── ResponseHeader.php │ │ ├── ResponseOp.php │ │ ├── SnapshotRequest.php │ │ ├── SnapshotResponse.php │ │ ├── StatusRequest.php │ │ ├── StatusResponse.php │ │ ├── TxnRequest.php │ │ ├── TxnResponse.php │ │ ├── WatchCancelRequest.php │ │ ├── WatchClient.php │ │ ├── WatchCreateRequest.php │ │ ├── WatchCreateRequest │ │ │ └── FilterType.php │ │ ├── WatchCreateRequest_FilterType.php │ │ ├── WatchProgressRequest.php │ │ ├── WatchRequest.php │ │ └── WatchResponse.php │ ├── GPBMetadata │ │ ├── Auth.php │ │ ├── Kv.php │ │ └── Rpc.php │ ├── Mvccpb │ │ ├── Event.php │ │ ├── Event │ │ │ └── EventType.php │ │ ├── Event_EventType.php │ │ └── KeyValue.php │ └── Proto │ │ ├── auth.proto │ │ ├── kv.proto │ │ └── rpc.proto ├── Grpc │ ├── BaseCall.php │ ├── BaseStub.php │ ├── BidiStreamingCall.php │ ├── Client.php │ ├── ClientStreamingCall.php │ ├── GPBMetadata │ │ └── Helloworld.php │ ├── Helloworld │ │ ├── GreeterClient.php │ │ ├── HelloReply.php │ │ └── HelloRequest.php │ ├── Parser.php │ ├── Proto │ │ └── helloworld.proto │ ├── Request.php │ ├── ServerStreamingCall.php │ ├── StreamingCall.php │ ├── VirtualClient.php │ └── VirtualClientGenerator └── include │ ├── functions.php │ └── ide-helper.php └── tools ├── generate_etcd.sh ├── generate_grpc.sh └── generator /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | composer.lock 3 | vendor/ 4 | debug/ -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "swoole/grpc", 3 | "type": "library", 4 | "keywords": [ 5 | "php", 6 | "swoole", 7 | "coroutine", 8 | "grpc", 9 | "etcd", 10 | "http", 11 | "http2", 12 | "client" 13 | ], 14 | "description": "Grpc PHP Client base on Swoole Http2 Coroutine", 15 | "license": "Apache-2.0", 16 | "authors": [ 17 | { 18 | "name": "twosee", 19 | "email": "twose@qq.com" 20 | } 21 | ], 22 | "support": { 23 | "issues": "https://github.com/swoole/grpc/issues" 24 | }, 25 | "require": { 26 | "php": ">=7.1", 27 | "google/protobuf": "^3" 28 | }, 29 | "autoload": { 30 | "classmap": [ 31 | "src/Grpc", 32 | "src/Etcd" 33 | ], 34 | "files": [ 35 | "src/include/functions.php" 36 | ] 37 | }, 38 | "config": { 39 | "optimize-autoloader": true, 40 | "sort-packages": true 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /examples/etcd/put.php: -------------------------------------------------------------------------------- 1 | setPrevKv(true); 11 | $request->setKey('Hello'); 12 | $request->setValue('Swoole'); 13 | [$reply, $status] = $kvClient->Put($request); 14 | if ($status === 0) { 15 | echo "{$reply->getPrevKv()->getKey()}\n"; 16 | echo "{$reply->getPrevKv()->getValue()}\n"; 17 | } else { 18 | echo "Error#{$status}: {$reply}\n"; 19 | } 20 | $kvClient->close(); 21 | }); 22 | -------------------------------------------------------------------------------- /examples/etcd/put_double.php: -------------------------------------------------------------------------------- 1 | setPrevKv(true); 11 | 12 | $barrier = Coroutine\Barrier::make(); 13 | 14 | Coroutine::create(function () use ($kvClient, $request, $barrier) { 15 | $request->setKey('Hello~'); 16 | $request->setValue('I am Swoole!'); 17 | [$reply, $status] = $kvClient->Put($request); 18 | if ($status === 0) { 19 | echo "{$reply->getPrevKv()->getKey()}\n"; 20 | echo "{$reply->getPrevKv()->getValue()}\n"; 21 | } else { 22 | echo "Error#{$status}: {$reply}\n"; 23 | } 24 | }); 25 | 26 | Coroutine::create(function () use ($kvClient, $request, $barrier) { 27 | $request->setKey('Hey~'); 28 | $request->setValue('How are u Etcd?'); 29 | [$reply, $status] = $kvClient->Put($request); 30 | if ($status === 0) { 31 | echo "{$reply->getPrevKv()->getKey()}\n"; 32 | echo "{$reply->getPrevKv()->getValue()}\n"; 33 | } else { 34 | echo "Error#{$status}: {$reply}\n"; 35 | } 36 | }); 37 | 38 | // wait all the responses back 39 | $barrier::wait($barrier); 40 | $kvClient->close(); 41 | }); 42 | -------------------------------------------------------------------------------- /examples/etcd/share_client.php: -------------------------------------------------------------------------------- 1 | $grpcClient]); 13 | $request = new Etcdserverpb\PutRequest(); 14 | $request->setPrevKv(true); 15 | $request->setKey('Hello'); 16 | $request->setValue('Swoole'); 17 | [$reply, $status] = $kvClient->Put($request); 18 | if ($status === 0) { 19 | echo "\n=== PUT KV OK ===\n"; 20 | } else { 21 | echo "Error#{$status}: {$reply}\n"; 22 | } 23 | }); 24 | 25 | Coroutine::create(function () use ($grpcClient) { 26 | $authClient = new Etcdserverpb\AuthClient(GRPC_SERVER_DEFAULT_URI, ['use' => $grpcClient]); 27 | 28 | $userRequest = new Etcdserverpb\AuthUserAddRequest(); 29 | $userNames = ['rango', 'twosee', 'gxh', 'stone', 'sjl']; 30 | foreach ($userNames as $username) { 31 | $userRequest->setName($username); 32 | [$reply, $status] = $authClient->UserAdd($userRequest); 33 | if ($status !== 0) { 34 | goto _error; 35 | } 36 | } 37 | 38 | $useListRequest = new Etcdserverpb\AuthUserListRequest(); 39 | [$reply, $status] = $authClient->UserList($useListRequest); 40 | if ($status !== 0) { 41 | goto _error; 42 | } 43 | echo "\n=== SHOW USER LIST ===\n"; 44 | foreach ($reply->getUsers() as $user) { 45 | /**@var \Authpb\User */ 46 | echo "* {$user}\n"; 47 | } 48 | echo "=== SHOW USER LIST OK ===\n"; 49 | 50 | $userRequest = new Etcdserverpb\AuthUserDeleteRequest(); 51 | foreach ($userNames as $username) { 52 | $userRequest->setName($username); 53 | [$reply, $status] = $authClient->UserDelete($userRequest); 54 | if ($status !== 0) { 55 | goto _error; 56 | } 57 | } 58 | 59 | if (false) { 60 | _error: 61 | echo "Error#{$status}: {$reply}\n"; 62 | } 63 | 64 | echo "\n=== SHOW ALL CLIENT STATS ===\n"; 65 | var_dump(grpc_client_num_stats()); 66 | $grpcClient->close(); 67 | }); 68 | 69 | }); 70 | -------------------------------------------------------------------------------- /examples/etcd/stress.php: -------------------------------------------------------------------------------- 1 | 10002]); 9 | Coroutine::create(function () { 10 | $kvClient = new Etcdserverpb\KVClient(GRPC_SERVER_DEFAULT_URI); 11 | $request = new Etcdserverpb\PutRequest(); 12 | $request->setPrevKv(true); 13 | $request->setValue('Swoole'); 14 | 15 | $barrier = Coroutine\Barrier::make(); 16 | $start = microtime(true); 17 | for ($i = 10000; $i--;) { 18 | Coroutine::create(function () use ($kvClient, $request, $i, $barrier) { 19 | $request->setKey("Hello{$i}"); 20 | [$reply, $status] = $kvClient->Put($request); 21 | assert($reply->getPrevKv()->getKey() === "Hello{$i}"); 22 | if ($status !== 0) { 23 | echo "Error#{$status}: {$reply}\n"; 24 | exit; 25 | } 26 | }); 27 | } 28 | 29 | // wait all the responses back 30 | $barrier::wait($barrier); 31 | $kvClient->close(); 32 | echo 'use time: ' . (microtime(true) - $start) . "s\n"; 33 | var_dump($kvClient->stats()); 34 | var_dump(memory_get_usage(true)); 35 | }); 36 | -------------------------------------------------------------------------------- /examples/etcd/watch.php: -------------------------------------------------------------------------------- 1 | Watch(); 15 | $request = new WatchRequest(); 16 | $createRequest = new WatchCreateRequest(); 17 | $createRequest->setKey('Hello'); 18 | $request->setCreateRequest($createRequest); 19 | 20 | _retry: 21 | $watchCall->push($request); 22 | /**@var $reply Etcdserverpb\WatchResponse */ 23 | while (true) { 24 | [$reply, $status] = $watchCall->recv(); 25 | if ($status === 0) { // success 26 | if ($reply->getCreated() || $reply->getCanceled()) { 27 | continue; 28 | } 29 | foreach ($reply->getEvents() as $event) { 30 | /**@var $event Mvccpb\Event */ 31 | $type = $event->getType(); 32 | $kv = $event->getKv(); 33 | if (FilterType::NOPUT === $type) { 34 | echo "Put key {$kv->getKey()} => {$kv->getValue()}\n"; 35 | break; 36 | } elseif (FilterType::NODELETE === $type) { 37 | echo "Delete key {$kv->getKey()}\n"; 38 | break; 39 | } 40 | } 41 | } else { // failed 42 | static $retry_time = 0; 43 | if ($watchClient->isConnected()) { 44 | $retry_time++; 45 | echo "Retry#{$retry_time}\n"; 46 | goto _retry; 47 | } else { 48 | echo "Error#{$status}: {$reply}\n"; 49 | break; 50 | } 51 | } 52 | } 53 | $watchClient->close(); 54 | }); 55 | 56 | // The Writer Put and Delete 57 | Coroutine::create(function () { 58 | $kvClient = new Etcdserverpb\KVClient(GRPC_SERVER_DEFAULT_URI); 59 | Coroutine::create(function () use ($kvClient) { 60 | $request = new Etcdserverpb\PutRequest(); 61 | $request->setKey('Hello'); 62 | $request->setPrevKv(true); 63 | while (true) { 64 | static $count = 0; 65 | Coroutine::sleep(.5); 66 | $request->setValue('Swoole#' . (++$count)); 67 | [$reply, $status] = $kvClient->Put($request); 68 | if ($status !== 0) { 69 | echo "Error#{$status}: {$reply}\n"; 70 | break; 71 | } 72 | } 73 | $kvClient->close(); 74 | }); 75 | Coroutine::create(function () use ($kvClient) { 76 | $request = new Etcdserverpb\DeleteRangeRequest(); 77 | $request->setKey('Hello'); 78 | $request->setPrevKv(true); 79 | while (true) { 80 | Coroutine::sleep(1); 81 | [$reply, $status] = $kvClient->DeleteRange($request); 82 | if ($status !== 0) { 83 | echo "Error#{$status}: {$reply}\n"; 84 | break; 85 | } 86 | } 87 | $kvClient->close(); 88 | }); 89 | }); 90 | -------------------------------------------------------------------------------- /examples/grpc/greeter_client.php: -------------------------------------------------------------------------------- 1 | setName($name); 14 | [$reply] = $greeterClient->SayHello($request); 15 | $message = $reply->getMessage(); 16 | echo "{$message}\n"; 17 | $greeterClient->close(); 18 | }); 19 | -------------------------------------------------------------------------------- /examples/grpc/greeter_server.php: -------------------------------------------------------------------------------- 1 | set([ 10 | 'log_level' => SWOOLE_LOG_INFO, 11 | 'trace_flags' => 0, 12 | 'worker_num' => 1, 13 | 'open_http2_protocol' => true 14 | ]); 15 | $http->on('workerStart', function (Swoole\Http\Server $server) { 16 | echo "php " . __DIR__ . "/greeter_client.php\n"; 17 | }); 18 | $http->on('request', function (Swoole\Http\Request $request, Swoole\Http\Response $response) use ($http) { 19 | $path = $request->server['request_uri']; 20 | $route = [ 21 | '/helloworld.Greeter/SayHello' => function (...$args) { 22 | [$server, $request, $response] = $args; 23 | /**@var $request_message HelloRequest */ 24 | $request_message = Grpc\Parser::deserializeMessage([HelloRequest::class, null], $request->rawContent()); 25 | if ($request_message) { 26 | $response_message = new HelloReply(); 27 | $response_message->setMessage('Hello ' . $request_message->getName()); 28 | $response->header('content-type', 'application/grpc'); 29 | $response->header('trailer', 'grpc-status, grpc-message'); 30 | $trailer = [ 31 | "grpc-status" => "0", 32 | "grpc-message" => "" 33 | ]; 34 | foreach ($trailer as $trailer_name => $trailer_value) { 35 | $response->trailer($trailer_name, $trailer_value); 36 | } 37 | $response->end(Grpc\Parser::serializeMessage($response_message)); 38 | return true; 39 | } 40 | return false; 41 | } 42 | ]; 43 | if (!(isset($route[$path]) && $route[$path]($http, $request, $response))) { 44 | $response->status(400); 45 | $response->end('Bad Request'); 46 | } 47 | }); 48 | $http->start(); -------------------------------------------------------------------------------- /examples/grpc/greeter_unix_client.php: -------------------------------------------------------------------------------- 1 | setName($name); 14 | [$reply] = $greeterClient->SayHello($request); 15 | $message = $reply->getMessage(); 16 | echo "{$message}\n"; 17 | $greeterClient->close(); 18 | }); 19 | -------------------------------------------------------------------------------- /examples/grpc/greeter_unix_server.php: -------------------------------------------------------------------------------- 1 | set([ 10 | 'log_level' => SWOOLE_LOG_INFO, 11 | 'trace_flags' => 0, 12 | 'worker_num' => 1, 13 | 'open_http2_protocol' => true 14 | ]); 15 | $http->on('workerStart', function (Swoole\Http\Server $server) { 16 | echo "php " . __DIR__ . "/greeter_unix_client.php\n"; 17 | }); 18 | $http->on('request', function (Swoole\Http\Request $request, Swoole\Http\Response $response) use ($http) { 19 | $path = $request->server['request_uri']; 20 | $route = [ 21 | '/helloworld.Greeter/SayHello' => function (...$args) { 22 | [$server, $request, $response] = $args; 23 | /**@var $request_message HelloRequest */ 24 | $request_message = Grpc\Parser::deserializeMessage([HelloRequest::class, null], $request->rawContent()); 25 | if ($request_message) { 26 | $response_message = new HelloReply(); 27 | $response_message->setMessage('Hello ' . $request_message->getName()); 28 | $response->header('content-type', 'application/grpc'); 29 | $response->header('trailer', 'grpc-status, grpc-message'); 30 | $trailer = [ 31 | "grpc-status" => "0", 32 | "grpc-message" => "" 33 | ]; 34 | foreach ($trailer as $trailer_name => $trailer_value) { 35 | $response->trailer($trailer_name, $trailer_value); 36 | } 37 | $response->end(Grpc\Parser::serializeMessage($response_message)); 38 | return true; 39 | } 40 | return false; 41 | } 42 | ]; 43 | if (!(isset($route[$path]) && $route[$path]($http, $request, $response))) { 44 | $response->status(400); 45 | $response->end('Bad Request'); 46 | } 47 | }); 48 | $http->start(); -------------------------------------------------------------------------------- /examples/grpc/helloworld/.gitignore: -------------------------------------------------------------------------------- 1 | greeter_client 2 | greeter_server 3 | node_modules 4 | -------------------------------------------------------------------------------- /examples/grpc/helloworld/greeter_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2015 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package main 20 | 21 | import ( 22 | "log" 23 | "os" 24 | "time" 25 | 26 | "golang.org/x/net/context" 27 | "google.golang.org/grpc" 28 | pb "google.golang.org/grpc/examples/helloworld/helloworld" 29 | ) 30 | 31 | const ( 32 | address = "localhost:50051" 33 | defaultName = "world" 34 | ) 35 | 36 | func main() { 37 | // Set up a connection to the server. 38 | conn, err := grpc.Dial(address, grpc.WithInsecure()) 39 | if err != nil { 40 | log.Fatalf("did not connect: %v", err) 41 | } 42 | defer conn.Close() 43 | c := pb.NewGreeterClient(conn) 44 | 45 | // Contact the server and print out its response. 46 | name := defaultName 47 | if len(os.Args) > 1 { 48 | name = os.Args[1] 49 | } 50 | ctx, cancel := context.WithTimeout(context.Background(), time.Second) 51 | defer cancel() 52 | r, err := c.SayHello(ctx, &pb.HelloRequest{Name: name}) 53 | if err != nil { 54 | log.Fatalf("could not greet: %v", err) 55 | } 56 | log.Printf("Greeting: %s", r.Message) 57 | } 58 | -------------------------------------------------------------------------------- /examples/grpc/helloworld/greeter_client.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2015 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | var PROTO_PATH = __dirname + '/../../protos/helloworld.proto'; 20 | 21 | var grpc = require('grpc'); 22 | var hello_proto = grpc.load(PROTO_PATH).helloworld; 23 | 24 | function main() { 25 | var client = new hello_proto.Greeter('localhost:50051', 26 | grpc.credentials.createInsecure()); 27 | var user; 28 | if (process.argv.length >= 3) { 29 | user = process.argv[2]; 30 | } else { 31 | user = 'world'; 32 | } 33 | client.sayHello({name: user}, function(err, response) { 34 | console.log(response); 35 | console.log('Greeting:', response.message); 36 | }); 37 | } 38 | 39 | main(); -------------------------------------------------------------------------------- /examples/grpc/helloworld/greeter_server.go: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2015 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | //go:generate protoc -I ../helloworld --go_out=plugins=grpc:../helloworld ../helloworld/helloworld.proto 20 | 21 | package main 22 | 23 | import ( 24 | "log" 25 | "net" 26 | 27 | "golang.org/x/net/context" 28 | "google.golang.org/grpc" 29 | pb "google.golang.org/grpc/examples/helloworld/helloworld" 30 | "google.golang.org/grpc/reflection" 31 | ) 32 | 33 | const ( 34 | port = ":50051" 35 | ) 36 | 37 | // server is used to implement helloworld.GreeterServer. 38 | type server struct{} 39 | 40 | // SayHello implements helloworld.GreeterServer 41 | func (s *server) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloReply, error) { 42 | return &pb.HelloReply{Message: "Hello " + in.Name}, nil 43 | } 44 | 45 | func main() { 46 | lis, err := net.Listen("tcp", port) 47 | if err != nil { 48 | log.Fatalf("failed to listen: %v", err) 49 | } 50 | s := grpc.NewServer() 51 | pb.RegisterGreeterServer(s, &server{}) 52 | // Register reflection service on gRPC server. 53 | reflection.Register(s) 54 | if err := s.Serve(lis); err != nil { 55 | log.Fatalf("failed to serve: %v", err) 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /examples/grpc/helloworld/greeter_server.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2015 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | var PROTO_PATH = __dirname + '../../../protos/helloworld.proto'; 20 | 21 | var grpc = require('grpc'); 22 | var protoLoader = require('@grpc/proto-loader'); 23 | var packageDefinition = protoLoader.loadSync( 24 | PROTO_PATH, 25 | {keepCase: true, 26 | longs: String, 27 | enums: String, 28 | defaults: true, 29 | oneofs: true 30 | }); 31 | var hello_proto = grpc.loadPackageDefinition(packageDefinition).helloworld; 32 | 33 | /** 34 | * Implements the SayHello RPC method. 35 | */ 36 | function sayHello(call, callback) { 37 | callback(null, {message: 'Hello Node Server - ' + call.request.name}); 38 | } 39 | 40 | /** 41 | * Starts an RPC server that receives requests for the Greeter service at the 42 | * sample server port 43 | */ 44 | function main() { 45 | var server = new grpc.Server(); 46 | server.addService(hello_proto.Greeter.service, {sayHello: sayHello}); 47 | server.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure()); 48 | server.start(); 49 | } 50 | 51 | main(); 52 | -------------------------------------------------------------------------------- /examples/protos/helloworld.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2015 gRPC authors. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | option java_multiple_files = true; 18 | option java_package = "io.grpc.examples.helloworld"; 19 | option java_outer_classname = "HelloWorldProto"; 20 | 21 | package helloworld; 22 | 23 | // The greeting service definition. 24 | service Greeter { 25 | // Sends a greeting 26 | rpc SayHello (HelloRequest) returns (HelloReply) {} 27 | } 28 | 29 | // The request message containing the user's name. 30 | message HelloRequest { 31 | string name = 1; 32 | } 33 | 34 | // The response message containing the greetings 35 | message HelloReply { 36 | string message = 1; 37 | } 38 | -------------------------------------------------------------------------------- /src/Etcd/Authpb/Permission.php: -------------------------------------------------------------------------------- 1 | authpb.Permission 15 | */ 16 | class Permission extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Generated from protobuf field .authpb.Permission.Type permType = 1; 20 | */ 21 | private $permType = 0; 22 | /** 23 | * Generated from protobuf field bytes key = 2; 24 | */ 25 | private $key = ''; 26 | /** 27 | * Generated from protobuf field bytes range_end = 3; 28 | */ 29 | private $range_end = ''; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type int $permType 38 | * @type string $key 39 | * @type string $range_end 40 | * } 41 | */ 42 | public function __construct($data = NULL) { 43 | \GPBMetadata\Auth::initOnce(); 44 | parent::__construct($data); 45 | } 46 | 47 | /** 48 | * Generated from protobuf field .authpb.Permission.Type permType = 1; 49 | * @return int 50 | */ 51 | public function getPermType() 52 | { 53 | return $this->permType; 54 | } 55 | 56 | /** 57 | * Generated from protobuf field .authpb.Permission.Type permType = 1; 58 | * @param int $var 59 | * @return $this 60 | */ 61 | public function setPermType($var) 62 | { 63 | GPBUtil::checkEnum($var, \Authpb\Permission_Type::class); 64 | $this->permType = $var; 65 | 66 | return $this; 67 | } 68 | 69 | /** 70 | * Generated from protobuf field bytes key = 2; 71 | * @return string 72 | */ 73 | public function getKey() 74 | { 75 | return $this->key; 76 | } 77 | 78 | /** 79 | * Generated from protobuf field bytes key = 2; 80 | * @param string $var 81 | * @return $this 82 | */ 83 | public function setKey($var) 84 | { 85 | GPBUtil::checkString($var, False); 86 | $this->key = $var; 87 | 88 | return $this; 89 | } 90 | 91 | /** 92 | * Generated from protobuf field bytes range_end = 3; 93 | * @return string 94 | */ 95 | public function getRangeEnd() 96 | { 97 | return $this->range_end; 98 | } 99 | 100 | /** 101 | * Generated from protobuf field bytes range_end = 3; 102 | * @param string $var 103 | * @return $this 104 | */ 105 | public function setRangeEnd($var) 106 | { 107 | GPBUtil::checkString($var, False); 108 | $this->range_end = $var; 109 | 110 | return $this; 111 | } 112 | 113 | } 114 | 115 | -------------------------------------------------------------------------------- /src/Etcd/Authpb/Permission/Type.php: -------------------------------------------------------------------------------- 1 | authpb.Permission.Type 9 | */ 10 | class Type 11 | { 12 | /** 13 | * Generated from protobuf enum READ = 0; 14 | */ 15 | const READ = 0; 16 | /** 17 | * Generated from protobuf enum WRITE = 1; 18 | */ 19 | const WRITE = 1; 20 | /** 21 | * Generated from protobuf enum READWRITE = 2; 22 | */ 23 | const READWRITE = 2; 24 | } 25 | 26 | // Adding a class alias for backwards compatibility with the previous class name. 27 | class_alias(Type::class, \Authpb\Permission_Type::class); 28 | 29 | -------------------------------------------------------------------------------- /src/Etcd/Authpb/Permission_Type.php: -------------------------------------------------------------------------------- 1 | authpb.Role 15 | */ 16 | class Role extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Generated from protobuf field bytes name = 1; 20 | */ 21 | private $name = ''; 22 | /** 23 | * Generated from protobuf field repeated .authpb.Permission keyPermission = 2; 24 | */ 25 | private $keyPermission; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type string $name 34 | * @type \Authpb\Permission[]|\Google\Protobuf\Internal\RepeatedField $keyPermission 35 | * } 36 | */ 37 | public function __construct($data = NULL) { 38 | \GPBMetadata\Auth::initOnce(); 39 | parent::__construct($data); 40 | } 41 | 42 | /** 43 | * Generated from protobuf field bytes name = 1; 44 | * @return string 45 | */ 46 | public function getName() 47 | { 48 | return $this->name; 49 | } 50 | 51 | /** 52 | * Generated from protobuf field bytes name = 1; 53 | * @param string $var 54 | * @return $this 55 | */ 56 | public function setName($var) 57 | { 58 | GPBUtil::checkString($var, False); 59 | $this->name = $var; 60 | 61 | return $this; 62 | } 63 | 64 | /** 65 | * Generated from protobuf field repeated .authpb.Permission keyPermission = 2; 66 | * @return \Google\Protobuf\Internal\RepeatedField 67 | */ 68 | public function getKeyPermission() 69 | { 70 | return $this->keyPermission; 71 | } 72 | 73 | /** 74 | * Generated from protobuf field repeated .authpb.Permission keyPermission = 2; 75 | * @param \Authpb\Permission[]|\Google\Protobuf\Internal\RepeatedField $var 76 | * @return $this 77 | */ 78 | public function setKeyPermission($var) 79 | { 80 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Authpb\Permission::class); 81 | $this->keyPermission = $arr; 82 | 83 | return $this; 84 | } 85 | 86 | } 87 | 88 | -------------------------------------------------------------------------------- /src/Etcd/Authpb/User.php: -------------------------------------------------------------------------------- 1 | authpb.User 15 | */ 16 | class User extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Generated from protobuf field bytes name = 1; 20 | */ 21 | private $name = ''; 22 | /** 23 | * Generated from protobuf field bytes password = 2; 24 | */ 25 | private $password = ''; 26 | /** 27 | * Generated from protobuf field repeated string roles = 3; 28 | */ 29 | private $roles; 30 | 31 | /** 32 | * Constructor. 33 | * 34 | * @param array $data { 35 | * Optional. Data for populating the Message object. 36 | * 37 | * @type string $name 38 | * @type string $password 39 | * @type string[]|\Google\Protobuf\Internal\RepeatedField $roles 40 | * } 41 | */ 42 | public function __construct($data = NULL) { 43 | \GPBMetadata\Auth::initOnce(); 44 | parent::__construct($data); 45 | } 46 | 47 | /** 48 | * Generated from protobuf field bytes name = 1; 49 | * @return string 50 | */ 51 | public function getName() 52 | { 53 | return $this->name; 54 | } 55 | 56 | /** 57 | * Generated from protobuf field bytes name = 1; 58 | * @param string $var 59 | * @return $this 60 | */ 61 | public function setName($var) 62 | { 63 | GPBUtil::checkString($var, False); 64 | $this->name = $var; 65 | 66 | return $this; 67 | } 68 | 69 | /** 70 | * Generated from protobuf field bytes password = 2; 71 | * @return string 72 | */ 73 | public function getPassword() 74 | { 75 | return $this->password; 76 | } 77 | 78 | /** 79 | * Generated from protobuf field bytes password = 2; 80 | * @param string $var 81 | * @return $this 82 | */ 83 | public function setPassword($var) 84 | { 85 | GPBUtil::checkString($var, False); 86 | $this->password = $var; 87 | 88 | return $this; 89 | } 90 | 91 | /** 92 | * Generated from protobuf field repeated string roles = 3; 93 | * @return \Google\Protobuf\Internal\RepeatedField 94 | */ 95 | public function getRoles() 96 | { 97 | return $this->roles; 98 | } 99 | 100 | /** 101 | * Generated from protobuf field repeated string roles = 3; 102 | * @param string[]|\Google\Protobuf\Internal\RepeatedField $var 103 | * @return $this 104 | */ 105 | public function setRoles($var) 106 | { 107 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); 108 | $this->roles = $arr; 109 | 110 | return $this; 111 | } 112 | 113 | } 114 | 115 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AlarmMember.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AlarmMember 13 | */ 14 | class AlarmMember extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * memberID is the ID of the member associated with the raised alarm. 18 | * 19 | * Generated from protobuf field uint64 memberID = 1; 20 | */ 21 | private $memberID = 0; 22 | /** 23 | * alarm is the type of alarm which has been raised. 24 | * 25 | * Generated from protobuf field .etcdserverpb.AlarmType alarm = 2; 26 | */ 27 | private $alarm = 0; 28 | 29 | /** 30 | * Constructor. 31 | * 32 | * @param array $data { 33 | * Optional. Data for populating the Message object. 34 | * 35 | * @type int|string $memberID 36 | * memberID is the ID of the member associated with the raised alarm. 37 | * @type int $alarm 38 | * alarm is the type of alarm which has been raised. 39 | * } 40 | */ 41 | public function __construct($data = NULL) { 42 | \GPBMetadata\Rpc::initOnce(); 43 | parent::__construct($data); 44 | } 45 | 46 | /** 47 | * memberID is the ID of the member associated with the raised alarm. 48 | * 49 | * Generated from protobuf field uint64 memberID = 1; 50 | * @return int|string 51 | */ 52 | public function getMemberID() 53 | { 54 | return $this->memberID; 55 | } 56 | 57 | /** 58 | * memberID is the ID of the member associated with the raised alarm. 59 | * 60 | * Generated from protobuf field uint64 memberID = 1; 61 | * @param int|string $var 62 | * @return $this 63 | */ 64 | public function setMemberID($var) 65 | { 66 | GPBUtil::checkUint64($var); 67 | $this->memberID = $var; 68 | 69 | return $this; 70 | } 71 | 72 | /** 73 | * alarm is the type of alarm which has been raised. 74 | * 75 | * Generated from protobuf field .etcdserverpb.AlarmType alarm = 2; 76 | * @return int 77 | */ 78 | public function getAlarm() 79 | { 80 | return $this->alarm; 81 | } 82 | 83 | /** 84 | * alarm is the type of alarm which has been raised. 85 | * 86 | * Generated from protobuf field .etcdserverpb.AlarmType alarm = 2; 87 | * @param int $var 88 | * @return $this 89 | */ 90 | public function setAlarm($var) 91 | { 92 | GPBUtil::checkEnum($var, \Etcdserverpb\AlarmType::class); 93 | $this->alarm = $var; 94 | 95 | return $this; 96 | } 97 | 98 | } 99 | 100 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AlarmRequest/AlarmAction.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AlarmRequest.AlarmAction 9 | */ 10 | class AlarmAction 11 | { 12 | /** 13 | * Generated from protobuf enum GET = 0; 14 | */ 15 | const GET = 0; 16 | /** 17 | * Generated from protobuf enum ACTIVATE = 1; 18 | */ 19 | const ACTIVATE = 1; 20 | /** 21 | * Generated from protobuf enum DEACTIVATE = 2; 22 | */ 23 | const DEACTIVATE = 2; 24 | } 25 | 26 | // Adding a class alias for backwards compatibility with the previous class name. 27 | class_alias(AlarmAction::class, \Etcdserverpb\AlarmRequest_AlarmAction::class); 28 | 29 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AlarmRequest_AlarmAction.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AlarmResponse 13 | */ 14 | class AlarmResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | /** 21 | * alarms is a list of alarms associated with the alarm request. 22 | * 23 | * Generated from protobuf field repeated .etcdserverpb.AlarmMember alarms = 2; 24 | */ 25 | private $alarms; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type \Etcdserverpb\ResponseHeader $header 34 | * @type \Etcdserverpb\AlarmMember[]|\Google\Protobuf\Internal\RepeatedField $alarms 35 | * alarms is a list of alarms associated with the alarm request. 36 | * } 37 | */ 38 | public function __construct($data = NULL) { 39 | \GPBMetadata\Rpc::initOnce(); 40 | parent::__construct($data); 41 | } 42 | 43 | /** 44 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 45 | * @return \Etcdserverpb\ResponseHeader 46 | */ 47 | public function getHeader() 48 | { 49 | return $this->header; 50 | } 51 | 52 | /** 53 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 54 | * @param \Etcdserverpb\ResponseHeader $var 55 | * @return $this 56 | */ 57 | public function setHeader($var) 58 | { 59 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 60 | $this->header = $var; 61 | 62 | return $this; 63 | } 64 | 65 | /** 66 | * alarms is a list of alarms associated with the alarm request. 67 | * 68 | * Generated from protobuf field repeated .etcdserverpb.AlarmMember alarms = 2; 69 | * @return \Google\Protobuf\Internal\RepeatedField 70 | */ 71 | public function getAlarms() 72 | { 73 | return $this->alarms; 74 | } 75 | 76 | /** 77 | * alarms is a list of alarms associated with the alarm request. 78 | * 79 | * Generated from protobuf field repeated .etcdserverpb.AlarmMember alarms = 2; 80 | * @param \Etcdserverpb\AlarmMember[]|\Google\Protobuf\Internal\RepeatedField $var 81 | * @return $this 82 | */ 83 | public function setAlarms($var) 84 | { 85 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Etcdserverpb\AlarmMember::class); 86 | $this->alarms = $arr; 87 | 88 | return $this; 89 | } 90 | 91 | } 92 | 93 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AlarmType.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AlarmType 9 | */ 10 | class AlarmType 11 | { 12 | /** 13 | * default, used to query if any alarm is active 14 | * 15 | * Generated from protobuf enum NONE = 0; 16 | */ 17 | const NONE = 0; 18 | /** 19 | * space quota is exhausted 20 | * 21 | * Generated from protobuf enum NOSPACE = 1; 22 | */ 23 | const NOSPACE = 1; 24 | /** 25 | * kv store corruption detected 26 | * 27 | * Generated from protobuf enum CORRUPT = 2; 28 | */ 29 | const CORRUPT = 2; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthDisableRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthDisableRequest 13 | */ 14 | class AuthDisableRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | 17 | /** 18 | * Constructor. 19 | * 20 | * @param array $data { 21 | * Optional. Data for populating the Message object. 22 | * 23 | * } 24 | */ 25 | public function __construct($data = NULL) { 26 | \GPBMetadata\Rpc::initOnce(); 27 | parent::__construct($data); 28 | } 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthDisableResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthDisableResponse 13 | */ 14 | class AuthDisableResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type \Etcdserverpb\ResponseHeader $header 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Rpc::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 37 | * @return \Etcdserverpb\ResponseHeader 38 | */ 39 | public function getHeader() 40 | { 41 | return $this->header; 42 | } 43 | 44 | /** 45 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 46 | * @param \Etcdserverpb\ResponseHeader $var 47 | * @return $this 48 | */ 49 | public function setHeader($var) 50 | { 51 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 52 | $this->header = $var; 53 | 54 | return $this; 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthEnableRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthEnableRequest 13 | */ 14 | class AuthEnableRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | 17 | /** 18 | * Constructor. 19 | * 20 | * @param array $data { 21 | * Optional. Data for populating the Message object. 22 | * 23 | * } 24 | */ 25 | public function __construct($data = NULL) { 26 | \GPBMetadata\Rpc::initOnce(); 27 | parent::__construct($data); 28 | } 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthEnableResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthEnableResponse 13 | */ 14 | class AuthEnableResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type \Etcdserverpb\ResponseHeader $header 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Rpc::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 37 | * @return \Etcdserverpb\ResponseHeader 38 | */ 39 | public function getHeader() 40 | { 41 | return $this->header; 42 | } 43 | 44 | /** 45 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 46 | * @param \Etcdserverpb\ResponseHeader $var 47 | * @return $this 48 | */ 49 | public function setHeader($var) 50 | { 51 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 52 | $this->header = $var; 53 | 54 | return $this; 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthRoleAddRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthRoleAddRequest 13 | */ 14 | class AuthRoleAddRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * name is the name of the role to add to the authentication system. 18 | * 19 | * Generated from protobuf field string name = 1; 20 | */ 21 | private $name = ''; 22 | 23 | /** 24 | * Constructor. 25 | * 26 | * @param array $data { 27 | * Optional. Data for populating the Message object. 28 | * 29 | * @type string $name 30 | * name is the name of the role to add to the authentication system. 31 | * } 32 | */ 33 | public function __construct($data = NULL) { 34 | \GPBMetadata\Rpc::initOnce(); 35 | parent::__construct($data); 36 | } 37 | 38 | /** 39 | * name is the name of the role to add to the authentication system. 40 | * 41 | * Generated from protobuf field string name = 1; 42 | * @return string 43 | */ 44 | public function getName() 45 | { 46 | return $this->name; 47 | } 48 | 49 | /** 50 | * name is the name of the role to add to the authentication system. 51 | * 52 | * Generated from protobuf field string name = 1; 53 | * @param string $var 54 | * @return $this 55 | */ 56 | public function setName($var) 57 | { 58 | GPBUtil::checkString($var, True); 59 | $this->name = $var; 60 | 61 | return $this; 62 | } 63 | 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthRoleAddResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthRoleAddResponse 13 | */ 14 | class AuthRoleAddResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type \Etcdserverpb\ResponseHeader $header 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Rpc::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 37 | * @return \Etcdserverpb\ResponseHeader 38 | */ 39 | public function getHeader() 40 | { 41 | return $this->header; 42 | } 43 | 44 | /** 45 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 46 | * @param \Etcdserverpb\ResponseHeader $var 47 | * @return $this 48 | */ 49 | public function setHeader($var) 50 | { 51 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 52 | $this->header = $var; 53 | 54 | return $this; 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthRoleDeleteRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthRoleDeleteRequest 13 | */ 14 | class AuthRoleDeleteRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field string role = 1; 18 | */ 19 | private $role = ''; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type string $role 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Rpc::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Generated from protobuf field string role = 1; 37 | * @return string 38 | */ 39 | public function getRole() 40 | { 41 | return $this->role; 42 | } 43 | 44 | /** 45 | * Generated from protobuf field string role = 1; 46 | * @param string $var 47 | * @return $this 48 | */ 49 | public function setRole($var) 50 | { 51 | GPBUtil::checkString($var, True); 52 | $this->role = $var; 53 | 54 | return $this; 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthRoleDeleteResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthRoleDeleteResponse 13 | */ 14 | class AuthRoleDeleteResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type \Etcdserverpb\ResponseHeader $header 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Rpc::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 37 | * @return \Etcdserverpb\ResponseHeader 38 | */ 39 | public function getHeader() 40 | { 41 | return $this->header; 42 | } 43 | 44 | /** 45 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 46 | * @param \Etcdserverpb\ResponseHeader $var 47 | * @return $this 48 | */ 49 | public function setHeader($var) 50 | { 51 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 52 | $this->header = $var; 53 | 54 | return $this; 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthRoleGetRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthRoleGetRequest 13 | */ 14 | class AuthRoleGetRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field string role = 1; 18 | */ 19 | private $role = ''; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type string $role 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Rpc::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Generated from protobuf field string role = 1; 37 | * @return string 38 | */ 39 | public function getRole() 40 | { 41 | return $this->role; 42 | } 43 | 44 | /** 45 | * Generated from protobuf field string role = 1; 46 | * @param string $var 47 | * @return $this 48 | */ 49 | public function setRole($var) 50 | { 51 | GPBUtil::checkString($var, True); 52 | $this->role = $var; 53 | 54 | return $this; 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthRoleGetResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthRoleGetResponse 13 | */ 14 | class AuthRoleGetResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | /** 21 | * Generated from protobuf field repeated .authpb.Permission perm = 2; 22 | */ 23 | private $perm; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type \Etcdserverpb\ResponseHeader $header 32 | * @type \Authpb\Permission[]|\Google\Protobuf\Internal\RepeatedField $perm 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Rpc::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 42 | * @return \Etcdserverpb\ResponseHeader 43 | */ 44 | public function getHeader() 45 | { 46 | return $this->header; 47 | } 48 | 49 | /** 50 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 51 | * @param \Etcdserverpb\ResponseHeader $var 52 | * @return $this 53 | */ 54 | public function setHeader($var) 55 | { 56 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 57 | $this->header = $var; 58 | 59 | return $this; 60 | } 61 | 62 | /** 63 | * Generated from protobuf field repeated .authpb.Permission perm = 2; 64 | * @return \Google\Protobuf\Internal\RepeatedField 65 | */ 66 | public function getPerm() 67 | { 68 | return $this->perm; 69 | } 70 | 71 | /** 72 | * Generated from protobuf field repeated .authpb.Permission perm = 2; 73 | * @param \Authpb\Permission[]|\Google\Protobuf\Internal\RepeatedField $var 74 | * @return $this 75 | */ 76 | public function setPerm($var) 77 | { 78 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Authpb\Permission::class); 79 | $this->perm = $arr; 80 | 81 | return $this; 82 | } 83 | 84 | } 85 | 86 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthRoleGrantPermissionRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthRoleGrantPermissionRequest 13 | */ 14 | class AuthRoleGrantPermissionRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * name is the name of the role which will be granted the permission. 18 | * 19 | * Generated from protobuf field string name = 1; 20 | */ 21 | private $name = ''; 22 | /** 23 | * perm is the permission to grant to the role. 24 | * 25 | * Generated from protobuf field .authpb.Permission perm = 2; 26 | */ 27 | private $perm = null; 28 | 29 | /** 30 | * Constructor. 31 | * 32 | * @param array $data { 33 | * Optional. Data for populating the Message object. 34 | * 35 | * @type string $name 36 | * name is the name of the role which will be granted the permission. 37 | * @type \Authpb\Permission $perm 38 | * perm is the permission to grant to the role. 39 | * } 40 | */ 41 | public function __construct($data = NULL) { 42 | \GPBMetadata\Rpc::initOnce(); 43 | parent::__construct($data); 44 | } 45 | 46 | /** 47 | * name is the name of the role which will be granted the permission. 48 | * 49 | * Generated from protobuf field string name = 1; 50 | * @return string 51 | */ 52 | public function getName() 53 | { 54 | return $this->name; 55 | } 56 | 57 | /** 58 | * name is the name of the role which will be granted the permission. 59 | * 60 | * Generated from protobuf field string name = 1; 61 | * @param string $var 62 | * @return $this 63 | */ 64 | public function setName($var) 65 | { 66 | GPBUtil::checkString($var, True); 67 | $this->name = $var; 68 | 69 | return $this; 70 | } 71 | 72 | /** 73 | * perm is the permission to grant to the role. 74 | * 75 | * Generated from protobuf field .authpb.Permission perm = 2; 76 | * @return \Authpb\Permission 77 | */ 78 | public function getPerm() 79 | { 80 | return $this->perm; 81 | } 82 | 83 | /** 84 | * perm is the permission to grant to the role. 85 | * 86 | * Generated from protobuf field .authpb.Permission perm = 2; 87 | * @param \Authpb\Permission $var 88 | * @return $this 89 | */ 90 | public function setPerm($var) 91 | { 92 | GPBUtil::checkMessage($var, \Authpb\Permission::class); 93 | $this->perm = $var; 94 | 95 | return $this; 96 | } 97 | 98 | } 99 | 100 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthRoleGrantPermissionResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthRoleGrantPermissionResponse 13 | */ 14 | class AuthRoleGrantPermissionResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type \Etcdserverpb\ResponseHeader $header 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Rpc::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 37 | * @return \Etcdserverpb\ResponseHeader 38 | */ 39 | public function getHeader() 40 | { 41 | return $this->header; 42 | } 43 | 44 | /** 45 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 46 | * @param \Etcdserverpb\ResponseHeader $var 47 | * @return $this 48 | */ 49 | public function setHeader($var) 50 | { 51 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 52 | $this->header = $var; 53 | 54 | return $this; 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthRoleListRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthRoleListRequest 13 | */ 14 | class AuthRoleListRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | 17 | /** 18 | * Constructor. 19 | * 20 | * @param array $data { 21 | * Optional. Data for populating the Message object. 22 | * 23 | * } 24 | */ 25 | public function __construct($data = NULL) { 26 | \GPBMetadata\Rpc::initOnce(); 27 | parent::__construct($data); 28 | } 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthRoleListResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthRoleListResponse 13 | */ 14 | class AuthRoleListResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | /** 21 | * Generated from protobuf field repeated string roles = 2; 22 | */ 23 | private $roles; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type \Etcdserverpb\ResponseHeader $header 32 | * @type string[]|\Google\Protobuf\Internal\RepeatedField $roles 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Rpc::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 42 | * @return \Etcdserverpb\ResponseHeader 43 | */ 44 | public function getHeader() 45 | { 46 | return $this->header; 47 | } 48 | 49 | /** 50 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 51 | * @param \Etcdserverpb\ResponseHeader $var 52 | * @return $this 53 | */ 54 | public function setHeader($var) 55 | { 56 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 57 | $this->header = $var; 58 | 59 | return $this; 60 | } 61 | 62 | /** 63 | * Generated from protobuf field repeated string roles = 2; 64 | * @return \Google\Protobuf\Internal\RepeatedField 65 | */ 66 | public function getRoles() 67 | { 68 | return $this->roles; 69 | } 70 | 71 | /** 72 | * Generated from protobuf field repeated string roles = 2; 73 | * @param string[]|\Google\Protobuf\Internal\RepeatedField $var 74 | * @return $this 75 | */ 76 | public function setRoles($var) 77 | { 78 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); 79 | $this->roles = $arr; 80 | 81 | return $this; 82 | } 83 | 84 | } 85 | 86 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthRoleRevokePermissionRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthRoleRevokePermissionRequest 13 | */ 14 | class AuthRoleRevokePermissionRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field string role = 1; 18 | */ 19 | private $role = ''; 20 | /** 21 | * Generated from protobuf field bytes key = 2; 22 | */ 23 | private $key = ''; 24 | /** 25 | * Generated from protobuf field bytes range_end = 3; 26 | */ 27 | private $range_end = ''; 28 | 29 | /** 30 | * Constructor. 31 | * 32 | * @param array $data { 33 | * Optional. Data for populating the Message object. 34 | * 35 | * @type string $role 36 | * @type string $key 37 | * @type string $range_end 38 | * } 39 | */ 40 | public function __construct($data = NULL) { 41 | \GPBMetadata\Rpc::initOnce(); 42 | parent::__construct($data); 43 | } 44 | 45 | /** 46 | * Generated from protobuf field string role = 1; 47 | * @return string 48 | */ 49 | public function getRole() 50 | { 51 | return $this->role; 52 | } 53 | 54 | /** 55 | * Generated from protobuf field string role = 1; 56 | * @param string $var 57 | * @return $this 58 | */ 59 | public function setRole($var) 60 | { 61 | GPBUtil::checkString($var, True); 62 | $this->role = $var; 63 | 64 | return $this; 65 | } 66 | 67 | /** 68 | * Generated from protobuf field bytes key = 2; 69 | * @return string 70 | */ 71 | public function getKey() 72 | { 73 | return $this->key; 74 | } 75 | 76 | /** 77 | * Generated from protobuf field bytes key = 2; 78 | * @param string $var 79 | * @return $this 80 | */ 81 | public function setKey($var) 82 | { 83 | GPBUtil::checkString($var, False); 84 | $this->key = $var; 85 | 86 | return $this; 87 | } 88 | 89 | /** 90 | * Generated from protobuf field bytes range_end = 3; 91 | * @return string 92 | */ 93 | public function getRangeEnd() 94 | { 95 | return $this->range_end; 96 | } 97 | 98 | /** 99 | * Generated from protobuf field bytes range_end = 3; 100 | * @param string $var 101 | * @return $this 102 | */ 103 | public function setRangeEnd($var) 104 | { 105 | GPBUtil::checkString($var, False); 106 | $this->range_end = $var; 107 | 108 | return $this; 109 | } 110 | 111 | } 112 | 113 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthRoleRevokePermissionResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthRoleRevokePermissionResponse 13 | */ 14 | class AuthRoleRevokePermissionResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type \Etcdserverpb\ResponseHeader $header 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Rpc::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 37 | * @return \Etcdserverpb\ResponseHeader 38 | */ 39 | public function getHeader() 40 | { 41 | return $this->header; 42 | } 43 | 44 | /** 45 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 46 | * @param \Etcdserverpb\ResponseHeader $var 47 | * @return $this 48 | */ 49 | public function setHeader($var) 50 | { 51 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 52 | $this->header = $var; 53 | 54 | return $this; 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthUserAddRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthUserAddRequest 13 | */ 14 | class AuthUserAddRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field string name = 1; 18 | */ 19 | private $name = ''; 20 | /** 21 | * Generated from protobuf field string password = 2; 22 | */ 23 | private $password = ''; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type string $name 32 | * @type string $password 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Rpc::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * Generated from protobuf field string name = 1; 42 | * @return string 43 | */ 44 | public function getName() 45 | { 46 | return $this->name; 47 | } 48 | 49 | /** 50 | * Generated from protobuf field string name = 1; 51 | * @param string $var 52 | * @return $this 53 | */ 54 | public function setName($var) 55 | { 56 | GPBUtil::checkString($var, True); 57 | $this->name = $var; 58 | 59 | return $this; 60 | } 61 | 62 | /** 63 | * Generated from protobuf field string password = 2; 64 | * @return string 65 | */ 66 | public function getPassword() 67 | { 68 | return $this->password; 69 | } 70 | 71 | /** 72 | * Generated from protobuf field string password = 2; 73 | * @param string $var 74 | * @return $this 75 | */ 76 | public function setPassword($var) 77 | { 78 | GPBUtil::checkString($var, True); 79 | $this->password = $var; 80 | 81 | return $this; 82 | } 83 | 84 | } 85 | 86 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthUserAddResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthUserAddResponse 13 | */ 14 | class AuthUserAddResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type \Etcdserverpb\ResponseHeader $header 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Rpc::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 37 | * @return \Etcdserverpb\ResponseHeader 38 | */ 39 | public function getHeader() 40 | { 41 | return $this->header; 42 | } 43 | 44 | /** 45 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 46 | * @param \Etcdserverpb\ResponseHeader $var 47 | * @return $this 48 | */ 49 | public function setHeader($var) 50 | { 51 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 52 | $this->header = $var; 53 | 54 | return $this; 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthUserChangePasswordRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthUserChangePasswordRequest 13 | */ 14 | class AuthUserChangePasswordRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * name is the name of the user whose password is being changed. 18 | * 19 | * Generated from protobuf field string name = 1; 20 | */ 21 | private $name = ''; 22 | /** 23 | * password is the new password for the user. 24 | * 25 | * Generated from protobuf field string password = 2; 26 | */ 27 | private $password = ''; 28 | 29 | /** 30 | * Constructor. 31 | * 32 | * @param array $data { 33 | * Optional. Data for populating the Message object. 34 | * 35 | * @type string $name 36 | * name is the name of the user whose password is being changed. 37 | * @type string $password 38 | * password is the new password for the user. 39 | * } 40 | */ 41 | public function __construct($data = NULL) { 42 | \GPBMetadata\Rpc::initOnce(); 43 | parent::__construct($data); 44 | } 45 | 46 | /** 47 | * name is the name of the user whose password is being changed. 48 | * 49 | * Generated from protobuf field string name = 1; 50 | * @return string 51 | */ 52 | public function getName() 53 | { 54 | return $this->name; 55 | } 56 | 57 | /** 58 | * name is the name of the user whose password is being changed. 59 | * 60 | * Generated from protobuf field string name = 1; 61 | * @param string $var 62 | * @return $this 63 | */ 64 | public function setName($var) 65 | { 66 | GPBUtil::checkString($var, True); 67 | $this->name = $var; 68 | 69 | return $this; 70 | } 71 | 72 | /** 73 | * password is the new password for the user. 74 | * 75 | * Generated from protobuf field string password = 2; 76 | * @return string 77 | */ 78 | public function getPassword() 79 | { 80 | return $this->password; 81 | } 82 | 83 | /** 84 | * password is the new password for the user. 85 | * 86 | * Generated from protobuf field string password = 2; 87 | * @param string $var 88 | * @return $this 89 | */ 90 | public function setPassword($var) 91 | { 92 | GPBUtil::checkString($var, True); 93 | $this->password = $var; 94 | 95 | return $this; 96 | } 97 | 98 | } 99 | 100 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthUserChangePasswordResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthUserChangePasswordResponse 13 | */ 14 | class AuthUserChangePasswordResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type \Etcdserverpb\ResponseHeader $header 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Rpc::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 37 | * @return \Etcdserverpb\ResponseHeader 38 | */ 39 | public function getHeader() 40 | { 41 | return $this->header; 42 | } 43 | 44 | /** 45 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 46 | * @param \Etcdserverpb\ResponseHeader $var 47 | * @return $this 48 | */ 49 | public function setHeader($var) 50 | { 51 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 52 | $this->header = $var; 53 | 54 | return $this; 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthUserDeleteRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthUserDeleteRequest 13 | */ 14 | class AuthUserDeleteRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * name is the name of the user to delete. 18 | * 19 | * Generated from protobuf field string name = 1; 20 | */ 21 | private $name = ''; 22 | 23 | /** 24 | * Constructor. 25 | * 26 | * @param array $data { 27 | * Optional. Data for populating the Message object. 28 | * 29 | * @type string $name 30 | * name is the name of the user to delete. 31 | * } 32 | */ 33 | public function __construct($data = NULL) { 34 | \GPBMetadata\Rpc::initOnce(); 35 | parent::__construct($data); 36 | } 37 | 38 | /** 39 | * name is the name of the user to delete. 40 | * 41 | * Generated from protobuf field string name = 1; 42 | * @return string 43 | */ 44 | public function getName() 45 | { 46 | return $this->name; 47 | } 48 | 49 | /** 50 | * name is the name of the user to delete. 51 | * 52 | * Generated from protobuf field string name = 1; 53 | * @param string $var 54 | * @return $this 55 | */ 56 | public function setName($var) 57 | { 58 | GPBUtil::checkString($var, True); 59 | $this->name = $var; 60 | 61 | return $this; 62 | } 63 | 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthUserDeleteResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthUserDeleteResponse 13 | */ 14 | class AuthUserDeleteResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type \Etcdserverpb\ResponseHeader $header 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Rpc::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 37 | * @return \Etcdserverpb\ResponseHeader 38 | */ 39 | public function getHeader() 40 | { 41 | return $this->header; 42 | } 43 | 44 | /** 45 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 46 | * @param \Etcdserverpb\ResponseHeader $var 47 | * @return $this 48 | */ 49 | public function setHeader($var) 50 | { 51 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 52 | $this->header = $var; 53 | 54 | return $this; 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthUserGetRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthUserGetRequest 13 | */ 14 | class AuthUserGetRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field string name = 1; 18 | */ 19 | private $name = ''; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type string $name 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Rpc::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Generated from protobuf field string name = 1; 37 | * @return string 38 | */ 39 | public function getName() 40 | { 41 | return $this->name; 42 | } 43 | 44 | /** 45 | * Generated from protobuf field string name = 1; 46 | * @param string $var 47 | * @return $this 48 | */ 49 | public function setName($var) 50 | { 51 | GPBUtil::checkString($var, True); 52 | $this->name = $var; 53 | 54 | return $this; 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthUserGetResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthUserGetResponse 13 | */ 14 | class AuthUserGetResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | /** 21 | * Generated from protobuf field repeated string roles = 2; 22 | */ 23 | private $roles; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type \Etcdserverpb\ResponseHeader $header 32 | * @type string[]|\Google\Protobuf\Internal\RepeatedField $roles 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Rpc::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 42 | * @return \Etcdserverpb\ResponseHeader 43 | */ 44 | public function getHeader() 45 | { 46 | return $this->header; 47 | } 48 | 49 | /** 50 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 51 | * @param \Etcdserverpb\ResponseHeader $var 52 | * @return $this 53 | */ 54 | public function setHeader($var) 55 | { 56 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 57 | $this->header = $var; 58 | 59 | return $this; 60 | } 61 | 62 | /** 63 | * Generated from protobuf field repeated string roles = 2; 64 | * @return \Google\Protobuf\Internal\RepeatedField 65 | */ 66 | public function getRoles() 67 | { 68 | return $this->roles; 69 | } 70 | 71 | /** 72 | * Generated from protobuf field repeated string roles = 2; 73 | * @param string[]|\Google\Protobuf\Internal\RepeatedField $var 74 | * @return $this 75 | */ 76 | public function setRoles($var) 77 | { 78 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); 79 | $this->roles = $arr; 80 | 81 | return $this; 82 | } 83 | 84 | } 85 | 86 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthUserGrantRoleRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthUserGrantRoleRequest 13 | */ 14 | class AuthUserGrantRoleRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * user is the name of the user which should be granted a given role. 18 | * 19 | * Generated from protobuf field string user = 1; 20 | */ 21 | private $user = ''; 22 | /** 23 | * role is the name of the role to grant to the user. 24 | * 25 | * Generated from protobuf field string role = 2; 26 | */ 27 | private $role = ''; 28 | 29 | /** 30 | * Constructor. 31 | * 32 | * @param array $data { 33 | * Optional. Data for populating the Message object. 34 | * 35 | * @type string $user 36 | * user is the name of the user which should be granted a given role. 37 | * @type string $role 38 | * role is the name of the role to grant to the user. 39 | * } 40 | */ 41 | public function __construct($data = NULL) { 42 | \GPBMetadata\Rpc::initOnce(); 43 | parent::__construct($data); 44 | } 45 | 46 | /** 47 | * user is the name of the user which should be granted a given role. 48 | * 49 | * Generated from protobuf field string user = 1; 50 | * @return string 51 | */ 52 | public function getUser() 53 | { 54 | return $this->user; 55 | } 56 | 57 | /** 58 | * user is the name of the user which should be granted a given role. 59 | * 60 | * Generated from protobuf field string user = 1; 61 | * @param string $var 62 | * @return $this 63 | */ 64 | public function setUser($var) 65 | { 66 | GPBUtil::checkString($var, True); 67 | $this->user = $var; 68 | 69 | return $this; 70 | } 71 | 72 | /** 73 | * role is the name of the role to grant to the user. 74 | * 75 | * Generated from protobuf field string role = 2; 76 | * @return string 77 | */ 78 | public function getRole() 79 | { 80 | return $this->role; 81 | } 82 | 83 | /** 84 | * role is the name of the role to grant to the user. 85 | * 86 | * Generated from protobuf field string role = 2; 87 | * @param string $var 88 | * @return $this 89 | */ 90 | public function setRole($var) 91 | { 92 | GPBUtil::checkString($var, True); 93 | $this->role = $var; 94 | 95 | return $this; 96 | } 97 | 98 | } 99 | 100 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthUserGrantRoleResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthUserGrantRoleResponse 13 | */ 14 | class AuthUserGrantRoleResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type \Etcdserverpb\ResponseHeader $header 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Rpc::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 37 | * @return \Etcdserverpb\ResponseHeader 38 | */ 39 | public function getHeader() 40 | { 41 | return $this->header; 42 | } 43 | 44 | /** 45 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 46 | * @param \Etcdserverpb\ResponseHeader $var 47 | * @return $this 48 | */ 49 | public function setHeader($var) 50 | { 51 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 52 | $this->header = $var; 53 | 54 | return $this; 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthUserListRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthUserListRequest 13 | */ 14 | class AuthUserListRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | 17 | /** 18 | * Constructor. 19 | * 20 | * @param array $data { 21 | * Optional. Data for populating the Message object. 22 | * 23 | * } 24 | */ 25 | public function __construct($data = NULL) { 26 | \GPBMetadata\Rpc::initOnce(); 27 | parent::__construct($data); 28 | } 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthUserListResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthUserListResponse 13 | */ 14 | class AuthUserListResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | /** 21 | * Generated from protobuf field repeated string users = 2; 22 | */ 23 | private $users; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type \Etcdserverpb\ResponseHeader $header 32 | * @type string[]|\Google\Protobuf\Internal\RepeatedField $users 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Rpc::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 42 | * @return \Etcdserverpb\ResponseHeader 43 | */ 44 | public function getHeader() 45 | { 46 | return $this->header; 47 | } 48 | 49 | /** 50 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 51 | * @param \Etcdserverpb\ResponseHeader $var 52 | * @return $this 53 | */ 54 | public function setHeader($var) 55 | { 56 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 57 | $this->header = $var; 58 | 59 | return $this; 60 | } 61 | 62 | /** 63 | * Generated from protobuf field repeated string users = 2; 64 | * @return \Google\Protobuf\Internal\RepeatedField 65 | */ 66 | public function getUsers() 67 | { 68 | return $this->users; 69 | } 70 | 71 | /** 72 | * Generated from protobuf field repeated string users = 2; 73 | * @param string[]|\Google\Protobuf\Internal\RepeatedField $var 74 | * @return $this 75 | */ 76 | public function setUsers($var) 77 | { 78 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); 79 | $this->users = $arr; 80 | 81 | return $this; 82 | } 83 | 84 | } 85 | 86 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthUserRevokeRoleRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthUserRevokeRoleRequest 13 | */ 14 | class AuthUserRevokeRoleRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field string name = 1; 18 | */ 19 | private $name = ''; 20 | /** 21 | * Generated from protobuf field string role = 2; 22 | */ 23 | private $role = ''; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type string $name 32 | * @type string $role 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Rpc::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * Generated from protobuf field string name = 1; 42 | * @return string 43 | */ 44 | public function getName() 45 | { 46 | return $this->name; 47 | } 48 | 49 | /** 50 | * Generated from protobuf field string name = 1; 51 | * @param string $var 52 | * @return $this 53 | */ 54 | public function setName($var) 55 | { 56 | GPBUtil::checkString($var, True); 57 | $this->name = $var; 58 | 59 | return $this; 60 | } 61 | 62 | /** 63 | * Generated from protobuf field string role = 2; 64 | * @return string 65 | */ 66 | public function getRole() 67 | { 68 | return $this->role; 69 | } 70 | 71 | /** 72 | * Generated from protobuf field string role = 2; 73 | * @param string $var 74 | * @return $this 75 | */ 76 | public function setRole($var) 77 | { 78 | GPBUtil::checkString($var, True); 79 | $this->role = $var; 80 | 81 | return $this; 82 | } 83 | 84 | } 85 | 86 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthUserRevokeRoleResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthUserRevokeRoleResponse 13 | */ 14 | class AuthUserRevokeRoleResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type \Etcdserverpb\ResponseHeader $header 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Rpc::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 37 | * @return \Etcdserverpb\ResponseHeader 38 | */ 39 | public function getHeader() 40 | { 41 | return $this->header; 42 | } 43 | 44 | /** 45 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 46 | * @param \Etcdserverpb\ResponseHeader $var 47 | * @return $this 48 | */ 49 | public function setHeader($var) 50 | { 51 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 52 | $this->header = $var; 53 | 54 | return $this; 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthenticateRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthenticateRequest 13 | */ 14 | class AuthenticateRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field string name = 1; 18 | */ 19 | private $name = ''; 20 | /** 21 | * Generated from protobuf field string password = 2; 22 | */ 23 | private $password = ''; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type string $name 32 | * @type string $password 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Rpc::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * Generated from protobuf field string name = 1; 42 | * @return string 43 | */ 44 | public function getName() 45 | { 46 | return $this->name; 47 | } 48 | 49 | /** 50 | * Generated from protobuf field string name = 1; 51 | * @param string $var 52 | * @return $this 53 | */ 54 | public function setName($var) 55 | { 56 | GPBUtil::checkString($var, True); 57 | $this->name = $var; 58 | 59 | return $this; 60 | } 61 | 62 | /** 63 | * Generated from protobuf field string password = 2; 64 | * @return string 65 | */ 66 | public function getPassword() 67 | { 68 | return $this->password; 69 | } 70 | 71 | /** 72 | * Generated from protobuf field string password = 2; 73 | * @param string $var 74 | * @return $this 75 | */ 76 | public function setPassword($var) 77 | { 78 | GPBUtil::checkString($var, True); 79 | $this->password = $var; 80 | 81 | return $this; 82 | } 83 | 84 | } 85 | 86 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/AuthenticateResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.AuthenticateResponse 13 | */ 14 | class AuthenticateResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | /** 21 | * token is an authorized token that can be used in succeeding RPCs 22 | * 23 | * Generated from protobuf field string token = 2; 24 | */ 25 | private $token = ''; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type \Etcdserverpb\ResponseHeader $header 34 | * @type string $token 35 | * token is an authorized token that can be used in succeeding RPCs 36 | * } 37 | */ 38 | public function __construct($data = NULL) { 39 | \GPBMetadata\Rpc::initOnce(); 40 | parent::__construct($data); 41 | } 42 | 43 | /** 44 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 45 | * @return \Etcdserverpb\ResponseHeader 46 | */ 47 | public function getHeader() 48 | { 49 | return $this->header; 50 | } 51 | 52 | /** 53 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 54 | * @param \Etcdserverpb\ResponseHeader $var 55 | * @return $this 56 | */ 57 | public function setHeader($var) 58 | { 59 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 60 | $this->header = $var; 61 | 62 | return $this; 63 | } 64 | 65 | /** 66 | * token is an authorized token that can be used in succeeding RPCs 67 | * 68 | * Generated from protobuf field string token = 2; 69 | * @return string 70 | */ 71 | public function getToken() 72 | { 73 | return $this->token; 74 | } 75 | 76 | /** 77 | * token is an authorized token that can be used in succeeding RPCs 78 | * 79 | * Generated from protobuf field string token = 2; 80 | * @param string $var 81 | * @return $this 82 | */ 83 | public function setToken($var) 84 | { 85 | GPBUtil::checkString($var, True); 86 | $this->token = $var; 87 | 88 | return $this; 89 | } 90 | 91 | } 92 | 93 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/ClusterClient.php: -------------------------------------------------------------------------------- 1 | _simpleRequest('/etcdserverpb.Cluster/MemberAdd', 29 | $argument, 30 | ['\Etcdserverpb\MemberAddResponse', 'decode'], 31 | $metadata, $options); 32 | } 33 | 34 | /** 35 | * MemberRemove removes an existing member from the cluster. 36 | * @param \Etcdserverpb\MemberRemoveRequest $argument input argument 37 | * @param array $metadata metadata 38 | * @param array $options call options 39 | * @return \Etcdserverpb\MemberRemoveResponse[]|\Grpc\StringifyAble[] 40 | */ 41 | public function MemberRemove(\Etcdserverpb\MemberRemoveRequest $argument, 42 | $metadata = [], $options = []) { 43 | return $this->_simpleRequest('/etcdserverpb.Cluster/MemberRemove', 44 | $argument, 45 | ['\Etcdserverpb\MemberRemoveResponse', 'decode'], 46 | $metadata, $options); 47 | } 48 | 49 | /** 50 | * MemberUpdate updates the member configuration. 51 | * @param \Etcdserverpb\MemberUpdateRequest $argument input argument 52 | * @param array $metadata metadata 53 | * @param array $options call options 54 | * @return \Etcdserverpb\MemberUpdateResponse[]|\Grpc\StringifyAble[] 55 | */ 56 | public function MemberUpdate(\Etcdserverpb\MemberUpdateRequest $argument, 57 | $metadata = [], $options = []) { 58 | return $this->_simpleRequest('/etcdserverpb.Cluster/MemberUpdate', 59 | $argument, 60 | ['\Etcdserverpb\MemberUpdateResponse', 'decode'], 61 | $metadata, $options); 62 | } 63 | 64 | /** 65 | * MemberList lists all the members in the cluster. 66 | * @param \Etcdserverpb\MemberListRequest $argument input argument 67 | * @param array $metadata metadata 68 | * @param array $options call options 69 | * @return \Etcdserverpb\MemberListResponse[]|\Grpc\StringifyAble[] 70 | */ 71 | public function MemberList(\Etcdserverpb\MemberListRequest $argument, 72 | $metadata = [], $options = []) { 73 | return $this->_simpleRequest('/etcdserverpb.Cluster/MemberList', 74 | $argument, 75 | ['\Etcdserverpb\MemberListResponse', 'decode'], 76 | $metadata, $options); 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/CompactionRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.CompactionRequest 16 | */ 17 | class CompactionRequest extends \Google\Protobuf\Internal\Message 18 | { 19 | /** 20 | * revision is the key-value store revision for the compaction operation. 21 | * 22 | * Generated from protobuf field int64 revision = 1; 23 | */ 24 | private $revision = 0; 25 | /** 26 | * physical is set so the RPC will wait until the compaction is physically 27 | * applied to the local database such that compacted entries are totally 28 | * removed from the backend database. 29 | * 30 | * Generated from protobuf field bool physical = 2; 31 | */ 32 | private $physical = false; 33 | 34 | /** 35 | * Constructor. 36 | * 37 | * @param array $data { 38 | * Optional. Data for populating the Message object. 39 | * 40 | * @type int|string $revision 41 | * revision is the key-value store revision for the compaction operation. 42 | * @type bool $physical 43 | * physical is set so the RPC will wait until the compaction is physically 44 | * applied to the local database such that compacted entries are totally 45 | * removed from the backend database. 46 | * } 47 | */ 48 | public function __construct($data = NULL) { 49 | \GPBMetadata\Rpc::initOnce(); 50 | parent::__construct($data); 51 | } 52 | 53 | /** 54 | * revision is the key-value store revision for the compaction operation. 55 | * 56 | * Generated from protobuf field int64 revision = 1; 57 | * @return int|string 58 | */ 59 | public function getRevision() 60 | { 61 | return $this->revision; 62 | } 63 | 64 | /** 65 | * revision is the key-value store revision for the compaction operation. 66 | * 67 | * Generated from protobuf field int64 revision = 1; 68 | * @param int|string $var 69 | * @return $this 70 | */ 71 | public function setRevision($var) 72 | { 73 | GPBUtil::checkInt64($var); 74 | $this->revision = $var; 75 | 76 | return $this; 77 | } 78 | 79 | /** 80 | * physical is set so the RPC will wait until the compaction is physically 81 | * applied to the local database such that compacted entries are totally 82 | * removed from the backend database. 83 | * 84 | * Generated from protobuf field bool physical = 2; 85 | * @return bool 86 | */ 87 | public function getPhysical() 88 | { 89 | return $this->physical; 90 | } 91 | 92 | /** 93 | * physical is set so the RPC will wait until the compaction is physically 94 | * applied to the local database such that compacted entries are totally 95 | * removed from the backend database. 96 | * 97 | * Generated from protobuf field bool physical = 2; 98 | * @param bool $var 99 | * @return $this 100 | */ 101 | public function setPhysical($var) 102 | { 103 | GPBUtil::checkBool($var); 104 | $this->physical = $var; 105 | 106 | return $this; 107 | } 108 | 109 | } 110 | 111 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/CompactionResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.CompactionResponse 13 | */ 14 | class CompactionResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type \Etcdserverpb\ResponseHeader $header 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Rpc::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 37 | * @return \Etcdserverpb\ResponseHeader 38 | */ 39 | public function getHeader() 40 | { 41 | return $this->header; 42 | } 43 | 44 | /** 45 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 46 | * @param \Etcdserverpb\ResponseHeader $var 47 | * @return $this 48 | */ 49 | public function setHeader($var) 50 | { 51 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 52 | $this->header = $var; 53 | 54 | return $this; 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/Compare/CompareResult.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.Compare.CompareResult 9 | */ 10 | class CompareResult 11 | { 12 | /** 13 | * Generated from protobuf enum EQUAL = 0; 14 | */ 15 | const EQUAL = 0; 16 | /** 17 | * Generated from protobuf enum GREATER = 1; 18 | */ 19 | const GREATER = 1; 20 | /** 21 | * Generated from protobuf enum LESS = 2; 22 | */ 23 | const LESS = 2; 24 | /** 25 | * Generated from protobuf enum NOT_EQUAL = 3; 26 | */ 27 | const NOT_EQUAL = 3; 28 | } 29 | 30 | // Adding a class alias for backwards compatibility with the previous class name. 31 | class_alias(CompareResult::class, \Etcdserverpb\Compare_CompareResult::class); 32 | 33 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/Compare/CompareTarget.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.Compare.CompareTarget 9 | */ 10 | class CompareTarget 11 | { 12 | /** 13 | * Generated from protobuf enum VERSION = 0; 14 | */ 15 | const VERSION = 0; 16 | /** 17 | * Generated from protobuf enum CREATE = 1; 18 | */ 19 | const CREATE = 1; 20 | /** 21 | * Generated from protobuf enum MOD = 2; 22 | */ 23 | const MOD = 2; 24 | /** 25 | * Generated from protobuf enum VALUE = 3; 26 | */ 27 | const VALUE = 3; 28 | /** 29 | * Generated from protobuf enum LEASE = 4; 30 | */ 31 | const LEASE = 4; 32 | } 33 | 34 | // Adding a class alias for backwards compatibility with the previous class name. 35 | class_alias(CompareTarget::class, \Etcdserverpb\Compare_CompareTarget::class); 36 | 37 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/Compare_CompareResult.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.DefragmentRequest 13 | */ 14 | class DefragmentRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | 17 | /** 18 | * Constructor. 19 | * 20 | * @param array $data { 21 | * Optional. Data for populating the Message object. 22 | * 23 | * } 24 | */ 25 | public function __construct($data = NULL) { 26 | \GPBMetadata\Rpc::initOnce(); 27 | parent::__construct($data); 28 | } 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/DefragmentResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.DefragmentResponse 13 | */ 14 | class DefragmentResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type \Etcdserverpb\ResponseHeader $header 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Rpc::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 37 | * @return \Etcdserverpb\ResponseHeader 38 | */ 39 | public function getHeader() 40 | { 41 | return $this->header; 42 | } 43 | 44 | /** 45 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 46 | * @param \Etcdserverpb\ResponseHeader $var 47 | * @return $this 48 | */ 49 | public function setHeader($var) 50 | { 51 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 52 | $this->header = $var; 53 | 54 | return $this; 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/HashKVRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.HashKVRequest 13 | */ 14 | class HashKVRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * revision is the key-value store revision for the hash operation. 18 | * 19 | * Generated from protobuf field int64 revision = 1; 20 | */ 21 | private $revision = 0; 22 | 23 | /** 24 | * Constructor. 25 | * 26 | * @param array $data { 27 | * Optional. Data for populating the Message object. 28 | * 29 | * @type int|string $revision 30 | * revision is the key-value store revision for the hash operation. 31 | * } 32 | */ 33 | public function __construct($data = NULL) { 34 | \GPBMetadata\Rpc::initOnce(); 35 | parent::__construct($data); 36 | } 37 | 38 | /** 39 | * revision is the key-value store revision for the hash operation. 40 | * 41 | * Generated from protobuf field int64 revision = 1; 42 | * @return int|string 43 | */ 44 | public function getRevision() 45 | { 46 | return $this->revision; 47 | } 48 | 49 | /** 50 | * revision is the key-value store revision for the hash operation. 51 | * 52 | * Generated from protobuf field int64 revision = 1; 53 | * @param int|string $var 54 | * @return $this 55 | */ 56 | public function setRevision($var) 57 | { 58 | GPBUtil::checkInt64($var); 59 | $this->revision = $var; 60 | 61 | return $this; 62 | } 63 | 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/HashRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.HashRequest 13 | */ 14 | class HashRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | 17 | /** 18 | * Constructor. 19 | * 20 | * @param array $data { 21 | * Optional. Data for populating the Message object. 22 | * 23 | * } 24 | */ 25 | public function __construct($data = NULL) { 26 | \GPBMetadata\Rpc::initOnce(); 27 | parent::__construct($data); 28 | } 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/HashResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.HashResponse 13 | */ 14 | class HashResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | /** 21 | * hash is the hash value computed from the responding member's KV's backend. 22 | * 23 | * Generated from protobuf field uint32 hash = 2; 24 | */ 25 | private $hash = 0; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type \Etcdserverpb\ResponseHeader $header 34 | * @type int $hash 35 | * hash is the hash value computed from the responding member's KV's backend. 36 | * } 37 | */ 38 | public function __construct($data = NULL) { 39 | \GPBMetadata\Rpc::initOnce(); 40 | parent::__construct($data); 41 | } 42 | 43 | /** 44 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 45 | * @return \Etcdserverpb\ResponseHeader 46 | */ 47 | public function getHeader() 48 | { 49 | return $this->header; 50 | } 51 | 52 | /** 53 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 54 | * @param \Etcdserverpb\ResponseHeader $var 55 | * @return $this 56 | */ 57 | public function setHeader($var) 58 | { 59 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 60 | $this->header = $var; 61 | 62 | return $this; 63 | } 64 | 65 | /** 66 | * hash is the hash value computed from the responding member's KV's backend. 67 | * 68 | * Generated from protobuf field uint32 hash = 2; 69 | * @return int 70 | */ 71 | public function getHash() 72 | { 73 | return $this->hash; 74 | } 75 | 76 | /** 77 | * hash is the hash value computed from the responding member's KV's backend. 78 | * 79 | * Generated from protobuf field uint32 hash = 2; 80 | * @param int $var 81 | * @return $this 82 | */ 83 | public function setHash($var) 84 | { 85 | GPBUtil::checkUint32($var); 86 | $this->hash = $var; 87 | 88 | return $this; 89 | } 90 | 91 | } 92 | 93 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/LeaseCheckpoint.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.LeaseCheckpoint 13 | */ 14 | class LeaseCheckpoint extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * ID is the lease ID to checkpoint. 18 | * 19 | * Generated from protobuf field int64 ID = 1; 20 | */ 21 | private $ID = 0; 22 | /** 23 | * Remaining_TTL is the remaining time until expiry of the lease. 24 | * 25 | * Generated from protobuf field int64 remaining_TTL = 2; 26 | */ 27 | private $remaining_TTL = 0; 28 | 29 | /** 30 | * Constructor. 31 | * 32 | * @param array $data { 33 | * Optional. Data for populating the Message object. 34 | * 35 | * @type int|string $ID 36 | * ID is the lease ID to checkpoint. 37 | * @type int|string $remaining_TTL 38 | * Remaining_TTL is the remaining time until expiry of the lease. 39 | * } 40 | */ 41 | public function __construct($data = NULL) { 42 | \GPBMetadata\Rpc::initOnce(); 43 | parent::__construct($data); 44 | } 45 | 46 | /** 47 | * ID is the lease ID to checkpoint. 48 | * 49 | * Generated from protobuf field int64 ID = 1; 50 | * @return int|string 51 | */ 52 | public function getID() 53 | { 54 | return $this->ID; 55 | } 56 | 57 | /** 58 | * ID is the lease ID to checkpoint. 59 | * 60 | * Generated from protobuf field int64 ID = 1; 61 | * @param int|string $var 62 | * @return $this 63 | */ 64 | public function setID($var) 65 | { 66 | GPBUtil::checkInt64($var); 67 | $this->ID = $var; 68 | 69 | return $this; 70 | } 71 | 72 | /** 73 | * Remaining_TTL is the remaining time until expiry of the lease. 74 | * 75 | * Generated from protobuf field int64 remaining_TTL = 2; 76 | * @return int|string 77 | */ 78 | public function getRemainingTTL() 79 | { 80 | return $this->remaining_TTL; 81 | } 82 | 83 | /** 84 | * Remaining_TTL is the remaining time until expiry of the lease. 85 | * 86 | * Generated from protobuf field int64 remaining_TTL = 2; 87 | * @param int|string $var 88 | * @return $this 89 | */ 90 | public function setRemainingTTL($var) 91 | { 92 | GPBUtil::checkInt64($var); 93 | $this->remaining_TTL = $var; 94 | 95 | return $this; 96 | } 97 | 98 | } 99 | 100 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/LeaseCheckpointRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.LeaseCheckpointRequest 13 | */ 14 | class LeaseCheckpointRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field repeated .etcdserverpb.LeaseCheckpoint checkpoints = 1; 18 | */ 19 | private $checkpoints; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type \Etcdserverpb\LeaseCheckpoint[]|\Google\Protobuf\Internal\RepeatedField $checkpoints 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Rpc::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Generated from protobuf field repeated .etcdserverpb.LeaseCheckpoint checkpoints = 1; 37 | * @return \Google\Protobuf\Internal\RepeatedField 38 | */ 39 | public function getCheckpoints() 40 | { 41 | return $this->checkpoints; 42 | } 43 | 44 | /** 45 | * Generated from protobuf field repeated .etcdserverpb.LeaseCheckpoint checkpoints = 1; 46 | * @param \Etcdserverpb\LeaseCheckpoint[]|\Google\Protobuf\Internal\RepeatedField $var 47 | * @return $this 48 | */ 49 | public function setCheckpoints($var) 50 | { 51 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Etcdserverpb\LeaseCheckpoint::class); 52 | $this->checkpoints = $arr; 53 | 54 | return $this; 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/LeaseCheckpointResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.LeaseCheckpointResponse 13 | */ 14 | class LeaseCheckpointResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type \Etcdserverpb\ResponseHeader $header 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Rpc::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 37 | * @return \Etcdserverpb\ResponseHeader 38 | */ 39 | public function getHeader() 40 | { 41 | return $this->header; 42 | } 43 | 44 | /** 45 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 46 | * @param \Etcdserverpb\ResponseHeader $var 47 | * @return $this 48 | */ 49 | public function setHeader($var) 50 | { 51 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 52 | $this->header = $var; 53 | 54 | return $this; 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/LeaseClient.php: -------------------------------------------------------------------------------- 1 | _simpleRequest('/etcdserverpb.Lease/LeaseGrant', 31 | $argument, 32 | ['\Etcdserverpb\LeaseGrantResponse', 'decode'], 33 | $metadata, $options); 34 | } 35 | 36 | /** 37 | * LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted. 38 | * @param \Etcdserverpb\LeaseRevokeRequest $argument input argument 39 | * @param array $metadata metadata 40 | * @param array $options call options 41 | * @return \Etcdserverpb\LeaseRevokeResponse[]|\Grpc\StringifyAble[] 42 | */ 43 | public function LeaseRevoke(\Etcdserverpb\LeaseRevokeRequest $argument, 44 | $metadata = [], $options = []) { 45 | return $this->_simpleRequest('/etcdserverpb.Lease/LeaseRevoke', 46 | $argument, 47 | ['\Etcdserverpb\LeaseRevokeResponse', 'decode'], 48 | $metadata, $options); 49 | } 50 | 51 | /** 52 | * LeaseKeepAlive keeps the lease alive by streaming keep alive requests from the client 53 | * to the server and streaming keep alive responses from the server to the client. 54 | * @param array $metadata metadata 55 | * @param array $options call options 56 | * @return bool|\Grpc\BidiStreamingCall 57 | */ 58 | public function LeaseKeepAlive($metadata = [], $options = []) { 59 | return $this->_bidiRequest('/etcdserverpb.Lease/LeaseKeepAlive', 60 | ['\Etcdserverpb\LeaseKeepAliveResponse','decode'], 61 | $metadata, $options); 62 | } 63 | 64 | /** 65 | * LeaseTimeToLive retrieves lease information. 66 | * @param \Etcdserverpb\LeaseTimeToLiveRequest $argument input argument 67 | * @param array $metadata metadata 68 | * @param array $options call options 69 | * @return \Etcdserverpb\LeaseTimeToLiveResponse[]|\Grpc\StringifyAble[] 70 | */ 71 | public function LeaseTimeToLive(\Etcdserverpb\LeaseTimeToLiveRequest $argument, 72 | $metadata = [], $options = []) { 73 | return $this->_simpleRequest('/etcdserverpb.Lease/LeaseTimeToLive', 74 | $argument, 75 | ['\Etcdserverpb\LeaseTimeToLiveResponse', 'decode'], 76 | $metadata, $options); 77 | } 78 | 79 | /** 80 | * LeaseLeases lists all existing leases. 81 | * @param \Etcdserverpb\LeaseLeasesRequest $argument input argument 82 | * @param array $metadata metadata 83 | * @param array $options call options 84 | * @return \Etcdserverpb\LeaseLeasesResponse[]|\Grpc\StringifyAble[] 85 | */ 86 | public function LeaseLeases(\Etcdserverpb\LeaseLeasesRequest $argument, 87 | $metadata = [], $options = []) { 88 | return $this->_simpleRequest('/etcdserverpb.Lease/LeaseLeases', 89 | $argument, 90 | ['\Etcdserverpb\LeaseLeasesResponse', 'decode'], 91 | $metadata, $options); 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/LeaseGrantRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.LeaseGrantRequest 13 | */ 14 | class LeaseGrantRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * TTL is the advisory time-to-live in seconds. Expired lease will return -1. 18 | * 19 | * Generated from protobuf field int64 TTL = 1; 20 | */ 21 | private $TTL = 0; 22 | /** 23 | * ID is the requested ID for the lease. If ID is set to 0, the lessor chooses an ID. 24 | * 25 | * Generated from protobuf field int64 ID = 2; 26 | */ 27 | private $ID = 0; 28 | 29 | /** 30 | * Constructor. 31 | * 32 | * @param array $data { 33 | * Optional. Data for populating the Message object. 34 | * 35 | * @type int|string $TTL 36 | * TTL is the advisory time-to-live in seconds. Expired lease will return -1. 37 | * @type int|string $ID 38 | * ID is the requested ID for the lease. If ID is set to 0, the lessor chooses an ID. 39 | * } 40 | */ 41 | public function __construct($data = NULL) { 42 | \GPBMetadata\Rpc::initOnce(); 43 | parent::__construct($data); 44 | } 45 | 46 | /** 47 | * TTL is the advisory time-to-live in seconds. Expired lease will return -1. 48 | * 49 | * Generated from protobuf field int64 TTL = 1; 50 | * @return int|string 51 | */ 52 | public function getTTL() 53 | { 54 | return $this->TTL; 55 | } 56 | 57 | /** 58 | * TTL is the advisory time-to-live in seconds. Expired lease will return -1. 59 | * 60 | * Generated from protobuf field int64 TTL = 1; 61 | * @param int|string $var 62 | * @return $this 63 | */ 64 | public function setTTL($var) 65 | { 66 | GPBUtil::checkInt64($var); 67 | $this->TTL = $var; 68 | 69 | return $this; 70 | } 71 | 72 | /** 73 | * ID is the requested ID for the lease. If ID is set to 0, the lessor chooses an ID. 74 | * 75 | * Generated from protobuf field int64 ID = 2; 76 | * @return int|string 77 | */ 78 | public function getID() 79 | { 80 | return $this->ID; 81 | } 82 | 83 | /** 84 | * ID is the requested ID for the lease. If ID is set to 0, the lessor chooses an ID. 85 | * 86 | * Generated from protobuf field int64 ID = 2; 87 | * @param int|string $var 88 | * @return $this 89 | */ 90 | public function setID($var) 91 | { 92 | GPBUtil::checkInt64($var); 93 | $this->ID = $var; 94 | 95 | return $this; 96 | } 97 | 98 | } 99 | 100 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/LeaseKeepAliveRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.LeaseKeepAliveRequest 13 | */ 14 | class LeaseKeepAliveRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * ID is the lease ID for the lease to keep alive. 18 | * 19 | * Generated from protobuf field int64 ID = 1; 20 | */ 21 | private $ID = 0; 22 | 23 | /** 24 | * Constructor. 25 | * 26 | * @param array $data { 27 | * Optional. Data for populating the Message object. 28 | * 29 | * @type int|string $ID 30 | * ID is the lease ID for the lease to keep alive. 31 | * } 32 | */ 33 | public function __construct($data = NULL) { 34 | \GPBMetadata\Rpc::initOnce(); 35 | parent::__construct($data); 36 | } 37 | 38 | /** 39 | * ID is the lease ID for the lease to keep alive. 40 | * 41 | * Generated from protobuf field int64 ID = 1; 42 | * @return int|string 43 | */ 44 | public function getID() 45 | { 46 | return $this->ID; 47 | } 48 | 49 | /** 50 | * ID is the lease ID for the lease to keep alive. 51 | * 52 | * Generated from protobuf field int64 ID = 1; 53 | * @param int|string $var 54 | * @return $this 55 | */ 56 | public function setID($var) 57 | { 58 | GPBUtil::checkInt64($var); 59 | $this->ID = $var; 60 | 61 | return $this; 62 | } 63 | 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/LeaseKeepAliveResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.LeaseKeepAliveResponse 13 | */ 14 | class LeaseKeepAliveResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | /** 21 | * ID is the lease ID from the keep alive request. 22 | * 23 | * Generated from protobuf field int64 ID = 2; 24 | */ 25 | private $ID = 0; 26 | /** 27 | * TTL is the new time-to-live for the lease. 28 | * 29 | * Generated from protobuf field int64 TTL = 3; 30 | */ 31 | private $TTL = 0; 32 | 33 | /** 34 | * Constructor. 35 | * 36 | * @param array $data { 37 | * Optional. Data for populating the Message object. 38 | * 39 | * @type \Etcdserverpb\ResponseHeader $header 40 | * @type int|string $ID 41 | * ID is the lease ID from the keep alive request. 42 | * @type int|string $TTL 43 | * TTL is the new time-to-live for the lease. 44 | * } 45 | */ 46 | public function __construct($data = NULL) { 47 | \GPBMetadata\Rpc::initOnce(); 48 | parent::__construct($data); 49 | } 50 | 51 | /** 52 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 53 | * @return \Etcdserverpb\ResponseHeader 54 | */ 55 | public function getHeader() 56 | { 57 | return $this->header; 58 | } 59 | 60 | /** 61 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 62 | * @param \Etcdserverpb\ResponseHeader $var 63 | * @return $this 64 | */ 65 | public function setHeader($var) 66 | { 67 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 68 | $this->header = $var; 69 | 70 | return $this; 71 | } 72 | 73 | /** 74 | * ID is the lease ID from the keep alive request. 75 | * 76 | * Generated from protobuf field int64 ID = 2; 77 | * @return int|string 78 | */ 79 | public function getID() 80 | { 81 | return $this->ID; 82 | } 83 | 84 | /** 85 | * ID is the lease ID from the keep alive request. 86 | * 87 | * Generated from protobuf field int64 ID = 2; 88 | * @param int|string $var 89 | * @return $this 90 | */ 91 | public function setID($var) 92 | { 93 | GPBUtil::checkInt64($var); 94 | $this->ID = $var; 95 | 96 | return $this; 97 | } 98 | 99 | /** 100 | * TTL is the new time-to-live for the lease. 101 | * 102 | * Generated from protobuf field int64 TTL = 3; 103 | * @return int|string 104 | */ 105 | public function getTTL() 106 | { 107 | return $this->TTL; 108 | } 109 | 110 | /** 111 | * TTL is the new time-to-live for the lease. 112 | * 113 | * Generated from protobuf field int64 TTL = 3; 114 | * @param int|string $var 115 | * @return $this 116 | */ 117 | public function setTTL($var) 118 | { 119 | GPBUtil::checkInt64($var); 120 | $this->TTL = $var; 121 | 122 | return $this; 123 | } 124 | 125 | } 126 | 127 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/LeaseLeasesRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.LeaseLeasesRequest 13 | */ 14 | class LeaseLeasesRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | 17 | /** 18 | * Constructor. 19 | * 20 | * @param array $data { 21 | * Optional. Data for populating the Message object. 22 | * 23 | * } 24 | */ 25 | public function __construct($data = NULL) { 26 | \GPBMetadata\Rpc::initOnce(); 27 | parent::__construct($data); 28 | } 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/LeaseLeasesResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.LeaseLeasesResponse 13 | */ 14 | class LeaseLeasesResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | /** 21 | * Generated from protobuf field repeated .etcdserverpb.LeaseStatus leases = 2; 22 | */ 23 | private $leases; 24 | 25 | /** 26 | * Constructor. 27 | * 28 | * @param array $data { 29 | * Optional. Data for populating the Message object. 30 | * 31 | * @type \Etcdserverpb\ResponseHeader $header 32 | * @type \Etcdserverpb\LeaseStatus[]|\Google\Protobuf\Internal\RepeatedField $leases 33 | * } 34 | */ 35 | public function __construct($data = NULL) { 36 | \GPBMetadata\Rpc::initOnce(); 37 | parent::__construct($data); 38 | } 39 | 40 | /** 41 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 42 | * @return \Etcdserverpb\ResponseHeader 43 | */ 44 | public function getHeader() 45 | { 46 | return $this->header; 47 | } 48 | 49 | /** 50 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 51 | * @param \Etcdserverpb\ResponseHeader $var 52 | * @return $this 53 | */ 54 | public function setHeader($var) 55 | { 56 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 57 | $this->header = $var; 58 | 59 | return $this; 60 | } 61 | 62 | /** 63 | * Generated from protobuf field repeated .etcdserverpb.LeaseStatus leases = 2; 64 | * @return \Google\Protobuf\Internal\RepeatedField 65 | */ 66 | public function getLeases() 67 | { 68 | return $this->leases; 69 | } 70 | 71 | /** 72 | * Generated from protobuf field repeated .etcdserverpb.LeaseStatus leases = 2; 73 | * @param \Etcdserverpb\LeaseStatus[]|\Google\Protobuf\Internal\RepeatedField $var 74 | * @return $this 75 | */ 76 | public function setLeases($var) 77 | { 78 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Etcdserverpb\LeaseStatus::class); 79 | $this->leases = $arr; 80 | 81 | return $this; 82 | } 83 | 84 | } 85 | 86 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/LeaseRevokeRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.LeaseRevokeRequest 13 | */ 14 | class LeaseRevokeRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * ID is the lease ID to revoke. When the ID is revoked, all associated keys will be deleted. 18 | * 19 | * Generated from protobuf field int64 ID = 1; 20 | */ 21 | private $ID = 0; 22 | 23 | /** 24 | * Constructor. 25 | * 26 | * @param array $data { 27 | * Optional. Data for populating the Message object. 28 | * 29 | * @type int|string $ID 30 | * ID is the lease ID to revoke. When the ID is revoked, all associated keys will be deleted. 31 | * } 32 | */ 33 | public function __construct($data = NULL) { 34 | \GPBMetadata\Rpc::initOnce(); 35 | parent::__construct($data); 36 | } 37 | 38 | /** 39 | * ID is the lease ID to revoke. When the ID is revoked, all associated keys will be deleted. 40 | * 41 | * Generated from protobuf field int64 ID = 1; 42 | * @return int|string 43 | */ 44 | public function getID() 45 | { 46 | return $this->ID; 47 | } 48 | 49 | /** 50 | * ID is the lease ID to revoke. When the ID is revoked, all associated keys will be deleted. 51 | * 52 | * Generated from protobuf field int64 ID = 1; 53 | * @param int|string $var 54 | * @return $this 55 | */ 56 | public function setID($var) 57 | { 58 | GPBUtil::checkInt64($var); 59 | $this->ID = $var; 60 | 61 | return $this; 62 | } 63 | 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/LeaseRevokeResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.LeaseRevokeResponse 13 | */ 14 | class LeaseRevokeResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type \Etcdserverpb\ResponseHeader $header 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Rpc::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 37 | * @return \Etcdserverpb\ResponseHeader 38 | */ 39 | public function getHeader() 40 | { 41 | return $this->header; 42 | } 43 | 44 | /** 45 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 46 | * @param \Etcdserverpb\ResponseHeader $var 47 | * @return $this 48 | */ 49 | public function setHeader($var) 50 | { 51 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 52 | $this->header = $var; 53 | 54 | return $this; 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/LeaseStatus.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.LeaseStatus 13 | */ 14 | class LeaseStatus extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * TODO: int64 TTL = 2; 18 | * 19 | * Generated from protobuf field int64 ID = 1; 20 | */ 21 | private $ID = 0; 22 | 23 | /** 24 | * Constructor. 25 | * 26 | * @param array $data { 27 | * Optional. Data for populating the Message object. 28 | * 29 | * @type int|string $ID 30 | * TODO: int64 TTL = 2; 31 | * } 32 | */ 33 | public function __construct($data = NULL) { 34 | \GPBMetadata\Rpc::initOnce(); 35 | parent::__construct($data); 36 | } 37 | 38 | /** 39 | * TODO: int64 TTL = 2; 40 | * 41 | * Generated from protobuf field int64 ID = 1; 42 | * @return int|string 43 | */ 44 | public function getID() 45 | { 46 | return $this->ID; 47 | } 48 | 49 | /** 50 | * TODO: int64 TTL = 2; 51 | * 52 | * Generated from protobuf field int64 ID = 1; 53 | * @param int|string $var 54 | * @return $this 55 | */ 56 | public function setID($var) 57 | { 58 | GPBUtil::checkInt64($var); 59 | $this->ID = $var; 60 | 61 | return $this; 62 | } 63 | 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/LeaseTimeToLiveRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.LeaseTimeToLiveRequest 13 | */ 14 | class LeaseTimeToLiveRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * ID is the lease ID for the lease. 18 | * 19 | * Generated from protobuf field int64 ID = 1; 20 | */ 21 | private $ID = 0; 22 | /** 23 | * keys is true to query all the keys attached to this lease. 24 | * 25 | * Generated from protobuf field bool keys = 2; 26 | */ 27 | private $keys = false; 28 | 29 | /** 30 | * Constructor. 31 | * 32 | * @param array $data { 33 | * Optional. Data for populating the Message object. 34 | * 35 | * @type int|string $ID 36 | * ID is the lease ID for the lease. 37 | * @type bool $keys 38 | * keys is true to query all the keys attached to this lease. 39 | * } 40 | */ 41 | public function __construct($data = NULL) { 42 | \GPBMetadata\Rpc::initOnce(); 43 | parent::__construct($data); 44 | } 45 | 46 | /** 47 | * ID is the lease ID for the lease. 48 | * 49 | * Generated from protobuf field int64 ID = 1; 50 | * @return int|string 51 | */ 52 | public function getID() 53 | { 54 | return $this->ID; 55 | } 56 | 57 | /** 58 | * ID is the lease ID for the lease. 59 | * 60 | * Generated from protobuf field int64 ID = 1; 61 | * @param int|string $var 62 | * @return $this 63 | */ 64 | public function setID($var) 65 | { 66 | GPBUtil::checkInt64($var); 67 | $this->ID = $var; 68 | 69 | return $this; 70 | } 71 | 72 | /** 73 | * keys is true to query all the keys attached to this lease. 74 | * 75 | * Generated from protobuf field bool keys = 2; 76 | * @return bool 77 | */ 78 | public function getKeys() 79 | { 80 | return $this->keys; 81 | } 82 | 83 | /** 84 | * keys is true to query all the keys attached to this lease. 85 | * 86 | * Generated from protobuf field bool keys = 2; 87 | * @param bool $var 88 | * @return $this 89 | */ 90 | public function setKeys($var) 91 | { 92 | GPBUtil::checkBool($var); 93 | $this->keys = $var; 94 | 95 | return $this; 96 | } 97 | 98 | } 99 | 100 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/MemberAddRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.MemberAddRequest 13 | */ 14 | class MemberAddRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * peerURLs is the list of URLs the added member will use to communicate with the cluster. 18 | * 19 | * Generated from protobuf field repeated string peerURLs = 1; 20 | */ 21 | private $peerURLs; 22 | 23 | /** 24 | * Constructor. 25 | * 26 | * @param array $data { 27 | * Optional. Data for populating the Message object. 28 | * 29 | * @type string[]|\Google\Protobuf\Internal\RepeatedField $peerURLs 30 | * peerURLs is the list of URLs the added member will use to communicate with the cluster. 31 | * } 32 | */ 33 | public function __construct($data = NULL) { 34 | \GPBMetadata\Rpc::initOnce(); 35 | parent::__construct($data); 36 | } 37 | 38 | /** 39 | * peerURLs is the list of URLs the added member will use to communicate with the cluster. 40 | * 41 | * Generated from protobuf field repeated string peerURLs = 1; 42 | * @return \Google\Protobuf\Internal\RepeatedField 43 | */ 44 | public function getPeerURLs() 45 | { 46 | return $this->peerURLs; 47 | } 48 | 49 | /** 50 | * peerURLs is the list of URLs the added member will use to communicate with the cluster. 51 | * 52 | * Generated from protobuf field repeated string peerURLs = 1; 53 | * @param string[]|\Google\Protobuf\Internal\RepeatedField $var 54 | * @return $this 55 | */ 56 | public function setPeerURLs($var) 57 | { 58 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); 59 | $this->peerURLs = $arr; 60 | 61 | return $this; 62 | } 63 | 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/MemberListRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.MemberListRequest 13 | */ 14 | class MemberListRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | 17 | /** 18 | * Constructor. 19 | * 20 | * @param array $data { 21 | * Optional. Data for populating the Message object. 22 | * 23 | * } 24 | */ 25 | public function __construct($data = NULL) { 26 | \GPBMetadata\Rpc::initOnce(); 27 | parent::__construct($data); 28 | } 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/MemberListResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.MemberListResponse 13 | */ 14 | class MemberListResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | /** 21 | * members is a list of all members associated with the cluster. 22 | * 23 | * Generated from protobuf field repeated .etcdserverpb.Member members = 2; 24 | */ 25 | private $members; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type \Etcdserverpb\ResponseHeader $header 34 | * @type \Etcdserverpb\Member[]|\Google\Protobuf\Internal\RepeatedField $members 35 | * members is a list of all members associated with the cluster. 36 | * } 37 | */ 38 | public function __construct($data = NULL) { 39 | \GPBMetadata\Rpc::initOnce(); 40 | parent::__construct($data); 41 | } 42 | 43 | /** 44 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 45 | * @return \Etcdserverpb\ResponseHeader 46 | */ 47 | public function getHeader() 48 | { 49 | return $this->header; 50 | } 51 | 52 | /** 53 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 54 | * @param \Etcdserverpb\ResponseHeader $var 55 | * @return $this 56 | */ 57 | public function setHeader($var) 58 | { 59 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 60 | $this->header = $var; 61 | 62 | return $this; 63 | } 64 | 65 | /** 66 | * members is a list of all members associated with the cluster. 67 | * 68 | * Generated from protobuf field repeated .etcdserverpb.Member members = 2; 69 | * @return \Google\Protobuf\Internal\RepeatedField 70 | */ 71 | public function getMembers() 72 | { 73 | return $this->members; 74 | } 75 | 76 | /** 77 | * members is a list of all members associated with the cluster. 78 | * 79 | * Generated from protobuf field repeated .etcdserverpb.Member members = 2; 80 | * @param \Etcdserverpb\Member[]|\Google\Protobuf\Internal\RepeatedField $var 81 | * @return $this 82 | */ 83 | public function setMembers($var) 84 | { 85 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Etcdserverpb\Member::class); 86 | $this->members = $arr; 87 | 88 | return $this; 89 | } 90 | 91 | } 92 | 93 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/MemberRemoveRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.MemberRemoveRequest 13 | */ 14 | class MemberRemoveRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * ID is the member ID of the member to remove. 18 | * 19 | * Generated from protobuf field uint64 ID = 1; 20 | */ 21 | private $ID = 0; 22 | 23 | /** 24 | * Constructor. 25 | * 26 | * @param array $data { 27 | * Optional. Data for populating the Message object. 28 | * 29 | * @type int|string $ID 30 | * ID is the member ID of the member to remove. 31 | * } 32 | */ 33 | public function __construct($data = NULL) { 34 | \GPBMetadata\Rpc::initOnce(); 35 | parent::__construct($data); 36 | } 37 | 38 | /** 39 | * ID is the member ID of the member to remove. 40 | * 41 | * Generated from protobuf field uint64 ID = 1; 42 | * @return int|string 43 | */ 44 | public function getID() 45 | { 46 | return $this->ID; 47 | } 48 | 49 | /** 50 | * ID is the member ID of the member to remove. 51 | * 52 | * Generated from protobuf field uint64 ID = 1; 53 | * @param int|string $var 54 | * @return $this 55 | */ 56 | public function setID($var) 57 | { 58 | GPBUtil::checkUint64($var); 59 | $this->ID = $var; 60 | 61 | return $this; 62 | } 63 | 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/MemberRemoveResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.MemberRemoveResponse 13 | */ 14 | class MemberRemoveResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | /** 21 | * members is a list of all members after removing the member. 22 | * 23 | * Generated from protobuf field repeated .etcdserverpb.Member members = 2; 24 | */ 25 | private $members; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type \Etcdserverpb\ResponseHeader $header 34 | * @type \Etcdserverpb\Member[]|\Google\Protobuf\Internal\RepeatedField $members 35 | * members is a list of all members after removing the member. 36 | * } 37 | */ 38 | public function __construct($data = NULL) { 39 | \GPBMetadata\Rpc::initOnce(); 40 | parent::__construct($data); 41 | } 42 | 43 | /** 44 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 45 | * @return \Etcdserverpb\ResponseHeader 46 | */ 47 | public function getHeader() 48 | { 49 | return $this->header; 50 | } 51 | 52 | /** 53 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 54 | * @param \Etcdserverpb\ResponseHeader $var 55 | * @return $this 56 | */ 57 | public function setHeader($var) 58 | { 59 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 60 | $this->header = $var; 61 | 62 | return $this; 63 | } 64 | 65 | /** 66 | * members is a list of all members after removing the member. 67 | * 68 | * Generated from protobuf field repeated .etcdserverpb.Member members = 2; 69 | * @return \Google\Protobuf\Internal\RepeatedField 70 | */ 71 | public function getMembers() 72 | { 73 | return $this->members; 74 | } 75 | 76 | /** 77 | * members is a list of all members after removing the member. 78 | * 79 | * Generated from protobuf field repeated .etcdserverpb.Member members = 2; 80 | * @param \Etcdserverpb\Member[]|\Google\Protobuf\Internal\RepeatedField $var 81 | * @return $this 82 | */ 83 | public function setMembers($var) 84 | { 85 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Etcdserverpb\Member::class); 86 | $this->members = $arr; 87 | 88 | return $this; 89 | } 90 | 91 | } 92 | 93 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/MemberUpdateRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.MemberUpdateRequest 13 | */ 14 | class MemberUpdateRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * ID is the member ID of the member to update. 18 | * 19 | * Generated from protobuf field uint64 ID = 1; 20 | */ 21 | private $ID = 0; 22 | /** 23 | * peerURLs is the new list of URLs the member will use to communicate with the cluster. 24 | * 25 | * Generated from protobuf field repeated string peerURLs = 2; 26 | */ 27 | private $peerURLs; 28 | 29 | /** 30 | * Constructor. 31 | * 32 | * @param array $data { 33 | * Optional. Data for populating the Message object. 34 | * 35 | * @type int|string $ID 36 | * ID is the member ID of the member to update. 37 | * @type string[]|\Google\Protobuf\Internal\RepeatedField $peerURLs 38 | * peerURLs is the new list of URLs the member will use to communicate with the cluster. 39 | * } 40 | */ 41 | public function __construct($data = NULL) { 42 | \GPBMetadata\Rpc::initOnce(); 43 | parent::__construct($data); 44 | } 45 | 46 | /** 47 | * ID is the member ID of the member to update. 48 | * 49 | * Generated from protobuf field uint64 ID = 1; 50 | * @return int|string 51 | */ 52 | public function getID() 53 | { 54 | return $this->ID; 55 | } 56 | 57 | /** 58 | * ID is the member ID of the member to update. 59 | * 60 | * Generated from protobuf field uint64 ID = 1; 61 | * @param int|string $var 62 | * @return $this 63 | */ 64 | public function setID($var) 65 | { 66 | GPBUtil::checkUint64($var); 67 | $this->ID = $var; 68 | 69 | return $this; 70 | } 71 | 72 | /** 73 | * peerURLs is the new list of URLs the member will use to communicate with the cluster. 74 | * 75 | * Generated from protobuf field repeated string peerURLs = 2; 76 | * @return \Google\Protobuf\Internal\RepeatedField 77 | */ 78 | public function getPeerURLs() 79 | { 80 | return $this->peerURLs; 81 | } 82 | 83 | /** 84 | * peerURLs is the new list of URLs the member will use to communicate with the cluster. 85 | * 86 | * Generated from protobuf field repeated string peerURLs = 2; 87 | * @param string[]|\Google\Protobuf\Internal\RepeatedField $var 88 | * @return $this 89 | */ 90 | public function setPeerURLs($var) 91 | { 92 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); 93 | $this->peerURLs = $arr; 94 | 95 | return $this; 96 | } 97 | 98 | } 99 | 100 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/MemberUpdateResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.MemberUpdateResponse 13 | */ 14 | class MemberUpdateResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | /** 21 | * members is a list of all members after updating the member. 22 | * 23 | * Generated from protobuf field repeated .etcdserverpb.Member members = 2; 24 | */ 25 | private $members; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type \Etcdserverpb\ResponseHeader $header 34 | * @type \Etcdserverpb\Member[]|\Google\Protobuf\Internal\RepeatedField $members 35 | * members is a list of all members after updating the member. 36 | * } 37 | */ 38 | public function __construct($data = NULL) { 39 | \GPBMetadata\Rpc::initOnce(); 40 | parent::__construct($data); 41 | } 42 | 43 | /** 44 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 45 | * @return \Etcdserverpb\ResponseHeader 46 | */ 47 | public function getHeader() 48 | { 49 | return $this->header; 50 | } 51 | 52 | /** 53 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 54 | * @param \Etcdserverpb\ResponseHeader $var 55 | * @return $this 56 | */ 57 | public function setHeader($var) 58 | { 59 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 60 | $this->header = $var; 61 | 62 | return $this; 63 | } 64 | 65 | /** 66 | * members is a list of all members after updating the member. 67 | * 68 | * Generated from protobuf field repeated .etcdserverpb.Member members = 2; 69 | * @return \Google\Protobuf\Internal\RepeatedField 70 | */ 71 | public function getMembers() 72 | { 73 | return $this->members; 74 | } 75 | 76 | /** 77 | * members is a list of all members after updating the member. 78 | * 79 | * Generated from protobuf field repeated .etcdserverpb.Member members = 2; 80 | * @param \Etcdserverpb\Member[]|\Google\Protobuf\Internal\RepeatedField $var 81 | * @return $this 82 | */ 83 | public function setMembers($var) 84 | { 85 | $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Etcdserverpb\Member::class); 86 | $this->members = $arr; 87 | 88 | return $this; 89 | } 90 | 91 | } 92 | 93 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/MoveLeaderRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.MoveLeaderRequest 13 | */ 14 | class MoveLeaderRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * targetID is the node ID for the new leader. 18 | * 19 | * Generated from protobuf field uint64 targetID = 1; 20 | */ 21 | private $targetID = 0; 22 | 23 | /** 24 | * Constructor. 25 | * 26 | * @param array $data { 27 | * Optional. Data for populating the Message object. 28 | * 29 | * @type int|string $targetID 30 | * targetID is the node ID for the new leader. 31 | * } 32 | */ 33 | public function __construct($data = NULL) { 34 | \GPBMetadata\Rpc::initOnce(); 35 | parent::__construct($data); 36 | } 37 | 38 | /** 39 | * targetID is the node ID for the new leader. 40 | * 41 | * Generated from protobuf field uint64 targetID = 1; 42 | * @return int|string 43 | */ 44 | public function getTargetID() 45 | { 46 | return $this->targetID; 47 | } 48 | 49 | /** 50 | * targetID is the node ID for the new leader. 51 | * 52 | * Generated from protobuf field uint64 targetID = 1; 53 | * @param int|string $var 54 | * @return $this 55 | */ 56 | public function setTargetID($var) 57 | { 58 | GPBUtil::checkUint64($var); 59 | $this->targetID = $var; 60 | 61 | return $this; 62 | } 63 | 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/MoveLeaderResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.MoveLeaderResponse 13 | */ 14 | class MoveLeaderResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | 21 | /** 22 | * Constructor. 23 | * 24 | * @param array $data { 25 | * Optional. Data for populating the Message object. 26 | * 27 | * @type \Etcdserverpb\ResponseHeader $header 28 | * } 29 | */ 30 | public function __construct($data = NULL) { 31 | \GPBMetadata\Rpc::initOnce(); 32 | parent::__construct($data); 33 | } 34 | 35 | /** 36 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 37 | * @return \Etcdserverpb\ResponseHeader 38 | */ 39 | public function getHeader() 40 | { 41 | return $this->header; 42 | } 43 | 44 | /** 45 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 46 | * @param \Etcdserverpb\ResponseHeader $var 47 | * @return $this 48 | */ 49 | public function setHeader($var) 50 | { 51 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 52 | $this->header = $var; 53 | 54 | return $this; 55 | } 56 | 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/PutResponse.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.PutResponse 13 | */ 14 | class PutResponse extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 18 | */ 19 | private $header = null; 20 | /** 21 | * if prev_kv is set in the request, the previous key-value pair will be returned. 22 | * 23 | * Generated from protobuf field .mvccpb.KeyValue prev_kv = 2; 24 | */ 25 | private $prev_kv = null; 26 | 27 | /** 28 | * Constructor. 29 | * 30 | * @param array $data { 31 | * Optional. Data for populating the Message object. 32 | * 33 | * @type \Etcdserverpb\ResponseHeader $header 34 | * @type \Mvccpb\KeyValue $prev_kv 35 | * if prev_kv is set in the request, the previous key-value pair will be returned. 36 | * } 37 | */ 38 | public function __construct($data = NULL) { 39 | \GPBMetadata\Rpc::initOnce(); 40 | parent::__construct($data); 41 | } 42 | 43 | /** 44 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 45 | * @return \Etcdserverpb\ResponseHeader 46 | */ 47 | public function getHeader() 48 | { 49 | return $this->header; 50 | } 51 | 52 | /** 53 | * Generated from protobuf field .etcdserverpb.ResponseHeader header = 1; 54 | * @param \Etcdserverpb\ResponseHeader $var 55 | * @return $this 56 | */ 57 | public function setHeader($var) 58 | { 59 | GPBUtil::checkMessage($var, \Etcdserverpb\ResponseHeader::class); 60 | $this->header = $var; 61 | 62 | return $this; 63 | } 64 | 65 | /** 66 | * if prev_kv is set in the request, the previous key-value pair will be returned. 67 | * 68 | * Generated from protobuf field .mvccpb.KeyValue prev_kv = 2; 69 | * @return \Mvccpb\KeyValue 70 | */ 71 | public function getPrevKv() 72 | { 73 | return $this->prev_kv; 74 | } 75 | 76 | /** 77 | * if prev_kv is set in the request, the previous key-value pair will be returned. 78 | * 79 | * Generated from protobuf field .mvccpb.KeyValue prev_kv = 2; 80 | * @param \Mvccpb\KeyValue $var 81 | * @return $this 82 | */ 83 | public function setPrevKv($var) 84 | { 85 | GPBUtil::checkMessage($var, \Mvccpb\KeyValue::class); 86 | $this->prev_kv = $var; 87 | 88 | return $this; 89 | } 90 | 91 | } 92 | 93 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/RangeRequest/SortOrder.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.RangeRequest.SortOrder 9 | */ 10 | class SortOrder 11 | { 12 | /** 13 | * default, no sorting 14 | * 15 | * Generated from protobuf enum NONE = 0; 16 | */ 17 | const NONE = 0; 18 | /** 19 | * lowest target value first 20 | * 21 | * Generated from protobuf enum ASCEND = 1; 22 | */ 23 | const ASCEND = 1; 24 | /** 25 | * highest target value first 26 | * 27 | * Generated from protobuf enum DESCEND = 2; 28 | */ 29 | const DESCEND = 2; 30 | } 31 | 32 | // Adding a class alias for backwards compatibility with the previous class name. 33 | class_alias(SortOrder::class, \Etcdserverpb\RangeRequest_SortOrder::class); 34 | 35 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/RangeRequest/SortTarget.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.RangeRequest.SortTarget 9 | */ 10 | class SortTarget 11 | { 12 | /** 13 | * Generated from protobuf enum KEY = 0; 14 | */ 15 | const KEY = 0; 16 | /** 17 | * Generated from protobuf enum VERSION = 1; 18 | */ 19 | const VERSION = 1; 20 | /** 21 | * Generated from protobuf enum CREATE = 2; 22 | */ 23 | const CREATE = 2; 24 | /** 25 | * Generated from protobuf enum MOD = 3; 26 | */ 27 | const MOD = 3; 28 | /** 29 | * Generated from protobuf enum VALUE = 4; 30 | */ 31 | const VALUE = 4; 32 | } 33 | 34 | // Adding a class alias for backwards compatibility with the previous class name. 35 | class_alias(SortTarget::class, \Etcdserverpb\RangeRequest_SortTarget::class); 36 | 37 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/RangeRequest_SortOrder.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.SnapshotRequest 13 | */ 14 | class SnapshotRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | 17 | /** 18 | * Constructor. 19 | * 20 | * @param array $data { 21 | * Optional. Data for populating the Message object. 22 | * 23 | * } 24 | */ 25 | public function __construct($data = NULL) { 26 | \GPBMetadata\Rpc::initOnce(); 27 | parent::__construct($data); 28 | } 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/StatusRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.StatusRequest 13 | */ 14 | class StatusRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | 17 | /** 18 | * Constructor. 19 | * 20 | * @param array $data { 21 | * Optional. Data for populating the Message object. 22 | * 23 | * } 24 | */ 25 | public function __construct($data = NULL) { 26 | \GPBMetadata\Rpc::initOnce(); 27 | parent::__construct($data); 28 | } 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/WatchCancelRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.WatchCancelRequest 13 | */ 14 | class WatchCancelRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | /** 17 | * watch_id is the watcher id to cancel so that no more events are transmitted. 18 | * 19 | * Generated from protobuf field int64 watch_id = 1; 20 | */ 21 | private $watch_id = 0; 22 | 23 | /** 24 | * Constructor. 25 | * 26 | * @param array $data { 27 | * Optional. Data for populating the Message object. 28 | * 29 | * @type int|string $watch_id 30 | * watch_id is the watcher id to cancel so that no more events are transmitted. 31 | * } 32 | */ 33 | public function __construct($data = NULL) { 34 | \GPBMetadata\Rpc::initOnce(); 35 | parent::__construct($data); 36 | } 37 | 38 | /** 39 | * watch_id is the watcher id to cancel so that no more events are transmitted. 40 | * 41 | * Generated from protobuf field int64 watch_id = 1; 42 | * @return int|string 43 | */ 44 | public function getWatchId() 45 | { 46 | return $this->watch_id; 47 | } 48 | 49 | /** 50 | * watch_id is the watcher id to cancel so that no more events are transmitted. 51 | * 52 | * Generated from protobuf field int64 watch_id = 1; 53 | * @param int|string $var 54 | * @return $this 55 | */ 56 | public function setWatchId($var) 57 | { 58 | GPBUtil::checkInt64($var); 59 | $this->watch_id = $var; 60 | 61 | return $this; 62 | } 63 | 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/WatchClient.php: -------------------------------------------------------------------------------- 1 | _bidiRequest('/etcdserverpb.Watch/Watch', 31 | ['\Etcdserverpb\WatchResponse','decode'], 32 | $metadata, $options); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/WatchCreateRequest/FilterType.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.WatchCreateRequest.FilterType 9 | */ 10 | class FilterType 11 | { 12 | /** 13 | * filter out put event. 14 | * 15 | * Generated from protobuf enum NOPUT = 0; 16 | */ 17 | const NOPUT = 0; 18 | /** 19 | * filter out delete event. 20 | * 21 | * Generated from protobuf enum NODELETE = 1; 22 | */ 23 | const NODELETE = 1; 24 | } 25 | 26 | // Adding a class alias for backwards compatibility with the previous class name. 27 | class_alias(FilterType::class, \Etcdserverpb\WatchCreateRequest_FilterType::class); 28 | 29 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/WatchCreateRequest_FilterType.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.WatchProgressRequest 16 | */ 17 | class WatchProgressRequest extends \Google\Protobuf\Internal\Message 18 | { 19 | 20 | /** 21 | * Constructor. 22 | * 23 | * @param array $data { 24 | * Optional. Data for populating the Message object. 25 | * 26 | * } 27 | */ 28 | public function __construct($data = NULL) { 29 | \GPBMetadata\Rpc::initOnce(); 30 | parent::__construct($data); 31 | } 32 | 33 | } 34 | 35 | -------------------------------------------------------------------------------- /src/Etcd/Etcdserverpb/WatchRequest.php: -------------------------------------------------------------------------------- 1 | etcdserverpb.WatchRequest 13 | */ 14 | class WatchRequest extends \Google\Protobuf\Internal\Message 15 | { 16 | protected $request_union; 17 | 18 | /** 19 | * Constructor. 20 | * 21 | * @param array $data { 22 | * Optional. Data for populating the Message object. 23 | * 24 | * @type \Etcdserverpb\WatchCreateRequest $create_request 25 | * @type \Etcdserverpb\WatchCancelRequest $cancel_request 26 | * @type \Etcdserverpb\WatchProgressRequest $progress_request 27 | * } 28 | */ 29 | public function __construct($data = NULL) { 30 | \GPBMetadata\Rpc::initOnce(); 31 | parent::__construct($data); 32 | } 33 | 34 | /** 35 | * Generated from protobuf field .etcdserverpb.WatchCreateRequest create_request = 1; 36 | * @return \Etcdserverpb\WatchCreateRequest 37 | */ 38 | public function getCreateRequest() 39 | { 40 | return $this->readOneof(1); 41 | } 42 | 43 | /** 44 | * Generated from protobuf field .etcdserverpb.WatchCreateRequest create_request = 1; 45 | * @param \Etcdserverpb\WatchCreateRequest $var 46 | * @return $this 47 | */ 48 | public function setCreateRequest($var) 49 | { 50 | GPBUtil::checkMessage($var, \Etcdserverpb\WatchCreateRequest::class); 51 | $this->writeOneof(1, $var); 52 | 53 | return $this; 54 | } 55 | 56 | /** 57 | * Generated from protobuf field .etcdserverpb.WatchCancelRequest cancel_request = 2; 58 | * @return \Etcdserverpb\WatchCancelRequest 59 | */ 60 | public function getCancelRequest() 61 | { 62 | return $this->readOneof(2); 63 | } 64 | 65 | /** 66 | * Generated from protobuf field .etcdserverpb.WatchCancelRequest cancel_request = 2; 67 | * @param \Etcdserverpb\WatchCancelRequest $var 68 | * @return $this 69 | */ 70 | public function setCancelRequest($var) 71 | { 72 | GPBUtil::checkMessage($var, \Etcdserverpb\WatchCancelRequest::class); 73 | $this->writeOneof(2, $var); 74 | 75 | return $this; 76 | } 77 | 78 | /** 79 | * Generated from protobuf field .etcdserverpb.WatchProgressRequest progress_request = 3; 80 | * @return \Etcdserverpb\WatchProgressRequest 81 | */ 82 | public function getProgressRequest() 83 | { 84 | return $this->readOneof(3); 85 | } 86 | 87 | /** 88 | * Generated from protobuf field .etcdserverpb.WatchProgressRequest progress_request = 3; 89 | * @param \Etcdserverpb\WatchProgressRequest $var 90 | * @return $this 91 | */ 92 | public function setProgressRequest($var) 93 | { 94 | GPBUtil::checkMessage($var, \Etcdserverpb\WatchProgressRequest::class); 95 | $this->writeOneof(3, $var); 96 | 97 | return $this; 98 | } 99 | 100 | /** 101 | * @return string 102 | */ 103 | public function getRequestUnion() 104 | { 105 | return $this->whichOneof("request_union"); 106 | } 107 | 108 | } 109 | 110 | -------------------------------------------------------------------------------- /src/Etcd/GPBMetadata/Auth.php: -------------------------------------------------------------------------------- 1 | internalAddGeneratedFile(hex2bin( 18 | "0a9a020a0a617574682e70726f746f120661757468706222350a04557365" . 19 | "72120c0a046e616d6518012001280c12100a0870617373776f7264180220" . 20 | "01280c120d0a05726f6c65731803200328092283010a0a5065726d697373" . 21 | "696f6e12290a087065726d5479706518012001280e32172e617574687062" . 22 | "2e5065726d697373696f6e2e54797065120b0a036b657918022001280c12" . 23 | "110a0972616e67655f656e6418032001280c222a0a045479706512080a04" . 24 | "52454144100012090a0557524954451001120d0a09524541445752495445" . 25 | "1002223f0a04526f6c65120c0a046e616d6518012001280c12290a0d6b65" . 26 | "795065726d697373696f6e18022003280b32122e6175746870622e506572" . 27 | "6d697373696f6e620670726f746f33" 28 | )); 29 | 30 | static::$is_initialized = true; 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /src/Etcd/GPBMetadata/Kv.php: -------------------------------------------------------------------------------- 1 | internalAddGeneratedFile(hex2bin( 18 | "0aa5020a086b762e70726f746f12066d766363706222750a084b65795661" . 19 | "6c7565120b0a036b657918012001280c12170a0f6372656174655f726576" . 20 | "6973696f6e18022001280312140a0c6d6f645f7265766973696f6e180320" . 21 | "012803120f0a0776657273696f6e180420012803120d0a0576616c756518" . 22 | "052001280c120d0a056c656173651806200128032291010a054576656e74" . 23 | "12250a047479706518012001280e32172e6d76636370622e4576656e742e" . 24 | "4576656e7454797065121c0a026b7618022001280b32102e6d7663637062" . 25 | "2e4b657956616c756512210a07707265765f6b7618032001280b32102e6d" . 26 | "76636370622e4b657956616c756522200a094576656e745479706512070a" . 27 | "035055541000120a0a0644454c4554451001620670726f746f33" 28 | )); 29 | 30 | static::$is_initialized = true; 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /src/Etcd/Mvccpb/Event/EventType.php: -------------------------------------------------------------------------------- 1 | mvccpb.Event.EventType 9 | */ 10 | class EventType 11 | { 12 | /** 13 | * Generated from protobuf enum PUT = 0; 14 | */ 15 | const PUT = 0; 16 | /** 17 | * Generated from protobuf enum DELETE = 1; 18 | */ 19 | const DELETE = 1; 20 | } 21 | 22 | // Adding a class alias for backwards compatibility with the previous class name. 23 | class_alias(EventType::class, \Mvccpb\Event_EventType::class); 24 | 25 | -------------------------------------------------------------------------------- /src/Etcd/Mvccpb/Event_EventType.php: -------------------------------------------------------------------------------- 1 | | 15 | +----------------------------------------------------------------------+ 16 | */ 17 | 18 | namespace Grpc; 19 | 20 | class BaseCall 21 | { 22 | /** @var Client */ 23 | protected $client; 24 | /** @var string */ 25 | protected $method; 26 | /** @var mixed */ 27 | protected $deserialize; 28 | /** @var int */ 29 | protected $streamId; 30 | 31 | public function setClient($client) 32 | { 33 | $this->client = $client; 34 | } 35 | 36 | public function setMethod(string $method) 37 | { 38 | $this->method = $method; 39 | } 40 | 41 | public function setDeserialize($deserialize) 42 | { 43 | $this->deserialize = $deserialize; 44 | } 45 | 46 | public function getStreamId(): int 47 | { 48 | return $this->streamId; 49 | } 50 | 51 | public function setStreamId(int $streamId) 52 | { 53 | $this->streamId = $streamId; 54 | } 55 | 56 | } -------------------------------------------------------------------------------- /src/Grpc/BidiStreamingCall.php: -------------------------------------------------------------------------------- 1 | | 15 | +----------------------------------------------------------------------+ 16 | */ 17 | 18 | namespace Grpc; 19 | 20 | /** 21 | * Represents an active call that allows for sending and recieving messages 22 | * in streams in any order. 23 | */ 24 | class BidiStreamingCall extends StreamingCall { } 25 | -------------------------------------------------------------------------------- /src/Grpc/ClientStreamingCall.php: -------------------------------------------------------------------------------- 1 | | 15 | +----------------------------------------------------------------------+ 16 | */ 17 | 18 | namespace Grpc; 19 | 20 | /** 21 | * Represents an active call that sends a stream of messages and then gets 22 | * a single response. 23 | */ 24 | class ClientStreamingCall extends StreamingCall 25 | { 26 | private $received = false; 27 | 28 | public function recv(float $timeout = GRPC_DEFAULT_TIMEOUT) 29 | { 30 | if (!$this->received) { 31 | $this->received = true; 32 | return parent::recv($timeout); 33 | } 34 | trigger_error('ClientStreamingCall can only recv once!', E_USER_ERROR); 35 | return false; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/Grpc/GPBMetadata/Helloworld.php: -------------------------------------------------------------------------------- 1 | internalAddGeneratedFile(hex2bin( 18 | "0ae0010a1068656c6c6f776f726c642e70726f746f120a68656c6c6f776f" . 19 | "726c64221c0a0c48656c6c6f52657175657374120c0a046e616d65180120" . 20 | "012809221d0a0a48656c6c6f5265706c79120f0a076d6573736167651801" . 21 | "2001280932490a0747726565746572123e0a0853617948656c6c6f12182e" . 22 | "68656c6c6f776f726c642e48656c6c6f526571756573741a162e68656c6c" . 23 | "6f776f726c642e48656c6c6f5265706c79220042300a1b696f2e67727063" . 24 | "2e6578616d706c65732e68656c6c6f776f726c64420f48656c6c6f576f72" . 25 | "6c6450726f746f5001620670726f746f33" 26 | )); 27 | 28 | static::$is_initialized = true; 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/Grpc/Helloworld/GreeterClient.php: -------------------------------------------------------------------------------- 1 | _simpleRequest('/helloworld.Greeter/SayHello', 45 | $argument, 46 | ['\Helloworld\HelloReply', 'decode'], 47 | $metadata, $options); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/Grpc/Helloworld/HelloReply.php: -------------------------------------------------------------------------------- 1 | helloworld.HelloReply 15 | */ 16 | class HelloReply extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Generated from protobuf field string message = 1; 20 | */ 21 | private $message = ''; 22 | 23 | /** 24 | * Constructor. 25 | * 26 | * @param array $data { 27 | * Optional. Data for populating the Message object. 28 | * 29 | * @type string $message 30 | * } 31 | */ 32 | public function __construct($data = NULL) { 33 | \GPBMetadata\Helloworld::initOnce(); 34 | parent::__construct($data); 35 | } 36 | 37 | /** 38 | * Generated from protobuf field string message = 1; 39 | * @return string 40 | */ 41 | public function getMessage() 42 | { 43 | return $this->message; 44 | } 45 | 46 | /** 47 | * Generated from protobuf field string message = 1; 48 | * @param string $var 49 | * @return $this 50 | */ 51 | public function setMessage($var) 52 | { 53 | GPBUtil::checkString($var, True); 54 | $this->message = $var; 55 | 56 | return $this; 57 | } 58 | 59 | } 60 | 61 | -------------------------------------------------------------------------------- /src/Grpc/Helloworld/HelloRequest.php: -------------------------------------------------------------------------------- 1 | helloworld.HelloRequest 15 | */ 16 | class HelloRequest extends \Google\Protobuf\Internal\Message 17 | { 18 | /** 19 | * Generated from protobuf field string name = 1; 20 | */ 21 | private $name = ''; 22 | 23 | /** 24 | * Constructor. 25 | * 26 | * @param array $data { 27 | * Optional. Data for populating the Message object. 28 | * 29 | * @type string $name 30 | * } 31 | */ 32 | public function __construct($data = NULL) { 33 | \GPBMetadata\Helloworld::initOnce(); 34 | parent::__construct($data); 35 | } 36 | 37 | /** 38 | * Generated from protobuf field string name = 1; 39 | * @return string 40 | */ 41 | public function getName() 42 | { 43 | return $this->name; 44 | } 45 | 46 | /** 47 | * Generated from protobuf field string name = 1; 48 | * @param string $var 49 | * @return $this 50 | */ 51 | public function setName($var) 52 | { 53 | GPBUtil::checkString($var, True); 54 | $this->name = $var; 55 | 56 | return $this; 57 | } 58 | 59 | } 60 | 61 | -------------------------------------------------------------------------------- /src/Grpc/Proto/helloworld.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2015 gRPC authors. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | option java_multiple_files = true; 18 | option java_package = "io.grpc.examples.helloworld"; 19 | option java_outer_classname = "HelloWorldProto"; 20 | 21 | package helloworld; 22 | 23 | // The greeting service definition. 24 | service Greeter { 25 | // Sends a greeting 26 | rpc SayHello (HelloRequest) returns (HelloReply) {} 27 | } 28 | 29 | // The request message containing the user's name. 30 | message HelloRequest { 31 | string name = 1; 32 | } 33 | 34 | // The response message containing the greetings 35 | message HelloReply { 36 | string message = 1; 37 | } 38 | -------------------------------------------------------------------------------- /src/Grpc/Request.php: -------------------------------------------------------------------------------- 1 | 4 | * Date: 2020/5/29 5:21 下午 5 | */ 6 | 7 | namespace Grpc; 8 | 9 | class Request extends \Swoole\Http2\Request 10 | { 11 | public $headers = [ 12 | 'content-type' => 'application/grpc', 13 | 'te' => 'trailers', 14 | 'user-agent' => 'grpc-swoole', 15 | ]; 16 | } 17 | -------------------------------------------------------------------------------- /src/Grpc/ServerStreamingCall.php: -------------------------------------------------------------------------------- 1 | | 15 | +----------------------------------------------------------------------+ 16 | */ 17 | 18 | namespace Grpc; 19 | 20 | use BadMethodCallException; 21 | 22 | /** 23 | * Represents an active call that sends a single message and then gets a 24 | * stream of responses. 25 | */ 26 | class ServerStreamingCall extends StreamingCall 27 | { 28 | public function push($message): bool 29 | { 30 | throw new BadMethodCallException('ServerStreamingCall can not push data by client'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Grpc/StreamingCall.php: -------------------------------------------------------------------------------- 1 | | 15 | +----------------------------------------------------------------------+ 16 | */ 17 | 18 | namespace Grpc; 19 | 20 | class StreamingCall extends BaseCall 21 | { 22 | public function send($message = null): bool 23 | { 24 | if (!$this->streamId) { 25 | $this->streamId = $this->client->openStream( 26 | $this->method, 27 | Parser::serializeMessage($message), 28 | '', 29 | true 30 | ); 31 | return $this->streamId > 0; 32 | } else { 33 | return false; 34 | } 35 | } 36 | 37 | public function push($message): bool 38 | { 39 | if (!$this->streamId) { 40 | $this->streamId = $this->client->openStream($this->method, null, '', true); 41 | } 42 | return $this->client->write($this->streamId, Parser::serializeMessage($message), false); 43 | } 44 | 45 | public function recv(float $timeout = -1) 46 | { 47 | if ($this->streamId <= 0) { 48 | $response = false; 49 | } else { 50 | $response = $this->client->recv($this->streamId, $timeout); 51 | if (!$this->client->isStreamExist($this->streamId)) { 52 | // stream lost, we need re-push 53 | $this->streamId = 0; 54 | } 55 | } 56 | return Parser::parseToResultArray($response, $this->deserialize); 57 | } 58 | 59 | public function end(): bool 60 | { 61 | if (!$this->streamId) { 62 | return false; 63 | } 64 | $ret = $this->client->write($this->streamId, null, true); 65 | if ($ret) { 66 | $this->streamId = 0; 67 | } 68 | return $ret; 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/include/functions.php: -------------------------------------------------------------------------------- 1 | | 15 | +----------------------------------------------------------------------+ 16 | */ 17 | 18 | const GRPC_DEFAULT_TIMEOUT = -1; 19 | const GRPC_ERROR_NO_RESPONSE = -1; 20 | define('GRPC_SERVER_DEFAULT_URI', ($tmp = getenv('GRPC_SERVER_DEFAULT_URI')) ? $tmp : '127.0.0.1:2379'); 21 | 22 | function grpc_client_num_stats(): array 23 | { 24 | return \Grpc\Client::numStats(); 25 | } 26 | 27 | function grpc_client_debug(bool $enable = true) 28 | { 29 | \Grpc\Client::debug($enable); 30 | } 31 | -------------------------------------------------------------------------------- /src/include/ide-helper.php: -------------------------------------------------------------------------------- 1 |