github.com/hashicorp/go-plugin@v1.6.0/internal/plugin/grpc_stdio.proto (about) 1 // Copyright (c) HashiCorp, Inc. 2 // SPDX-License-Identifier: MPL-2.0 3 4 syntax = "proto3"; 5 package plugin; 6 option go_package = "./plugin"; 7 8 import "google/protobuf/empty.proto"; 9 10 // GRPCStdio is a service that is automatically run by the plugin process 11 // to stream any stdout/err data so that it can be mirrored on the plugin 12 // host side. 13 service GRPCStdio { 14 // StreamStdio returns a stream that contains all the stdout/stderr. 15 // This RPC endpoint must only be called ONCE. Once stdio data is consumed 16 // it is not sent again. 17 // 18 // Callers should connect early to prevent blocking on the plugin process. 19 rpc StreamStdio(google.protobuf.Empty) returns (stream StdioData); 20 } 21 22 // StdioData is a single chunk of stdout or stderr data that is streamed 23 // from GRPCStdio. 24 message StdioData { 25 enum Channel { 26 INVALID = 0; 27 STDOUT = 1; 28 STDERR = 2; 29 } 30 31 Channel channel = 1; 32 bytes data = 2; 33 }