diff --git a/component/arm/v1/arm.pb.gw.go b/component/arm/v1/arm.pb.gw.go index e9d51a96f..90c742bb6 100644 --- a/component/arm/v1/arm.pb.gw.go +++ b/component/arm/v1/arm.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "go.viam.com/api/common/v1" + v1_0 "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -439,7 +439,7 @@ var ( ) func request_ArmService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client ArmServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -472,7 +472,7 @@ func request_ArmService_DoCommand_0(ctx context.Context, marshaler runtime.Marsh } func local_request_ArmService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server ArmServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -509,7 +509,7 @@ var ( ) func request_ArmService_GetKinematics_0(ctx context.Context, marshaler runtime.Marshaler, client ArmServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.GetKinematicsRequest + var protoReq v1_0.GetKinematicsRequest var metadata runtime.ServerMetadata var ( @@ -542,7 +542,7 @@ func request_ArmService_GetKinematics_0(ctx context.Context, marshaler runtime.M } func local_request_ArmService_GetKinematics_0(ctx context.Context, marshaler runtime.Marshaler, server ArmServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.GetKinematicsRequest + var protoReq v1_0.GetKinematicsRequest var metadata runtime.ServerMetadata var ( @@ -579,7 +579,7 @@ var ( ) func request_ArmService_GetGeometries_0(ctx context.Context, marshaler runtime.Marshaler, client ArmServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.GetGeometriesRequest + var protoReq v1_0.GetGeometriesRequest var metadata runtime.ServerMetadata var ( @@ -612,7 +612,7 @@ func request_ArmService_GetGeometries_0(ctx context.Context, marshaler runtime.M } func local_request_ArmService_GetGeometries_0(ctx context.Context, marshaler runtime.Marshaler, server ArmServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.GetGeometriesRequest + var protoReq v1_0.GetGeometriesRequest var metadata runtime.ServerMetadata var ( diff --git a/component/audioinput/v1/audioinput.pb.gw.go b/component/audioinput/v1/audioinput.pb.gw.go index 571f1e11f..97662546a 100644 --- a/component/audioinput/v1/audioinput.pb.gw.go +++ b/component/audioinput/v1/audioinput.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - v1_0 "go.viam.com/api/common/v1" + "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -184,7 +184,7 @@ var ( ) func request_AudioInputService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client AudioInputServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.DoCommandRequest + var protoReq v1.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -217,7 +217,7 @@ func request_AudioInputService_DoCommand_0(ctx context.Context, marshaler runtim } func local_request_AudioInputService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server AudioInputServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.DoCommandRequest + var protoReq v1.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -254,7 +254,7 @@ var ( ) func request_AudioInputService_GetGeometries_0(ctx context.Context, marshaler runtime.Marshaler, client AudioInputServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.GetGeometriesRequest + var protoReq v1.GetGeometriesRequest var metadata runtime.ServerMetadata var ( @@ -287,7 +287,7 @@ func request_AudioInputService_GetGeometries_0(ctx context.Context, marshaler ru } func local_request_AudioInputService_GetGeometries_0(ctx context.Context, marshaler runtime.Marshaler, server AudioInputServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.GetGeometriesRequest + var protoReq v1.GetGeometriesRequest var metadata runtime.ServerMetadata var ( diff --git a/component/gantry/v1/gantry.pb.gw.go b/component/gantry/v1/gantry.pb.gw.go index e78f11c29..13a62b8f4 100644 --- a/component/gantry/v1/gantry.pb.gw.go +++ b/component/gantry/v1/gantry.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - v1_0 "go.viam.com/api/common/v1" + "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -439,7 +439,7 @@ var ( ) func request_GantryService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client GantryServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.DoCommandRequest + var protoReq v1.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -472,7 +472,7 @@ func request_GantryService_DoCommand_0(ctx context.Context, marshaler runtime.Ma } func local_request_GantryService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server GantryServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.DoCommandRequest + var protoReq v1.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -509,7 +509,7 @@ var ( ) func request_GantryService_GetGeometries_0(ctx context.Context, marshaler runtime.Marshaler, client GantryServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.GetGeometriesRequest + var protoReq v1.GetGeometriesRequest var metadata runtime.ServerMetadata var ( @@ -542,7 +542,7 @@ func request_GantryService_GetGeometries_0(ctx context.Context, marshaler runtim } func local_request_GantryService_GetGeometries_0(ctx context.Context, marshaler runtime.Marshaler, server GantryServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.GetGeometriesRequest + var protoReq v1.GetGeometriesRequest var metadata runtime.ServerMetadata var ( diff --git a/component/inputcontroller/v1/input_controller.pb.gw.go b/component/inputcontroller/v1/input_controller.pb.gw.go index 199f00f1d..65d0cf631 100644 --- a/component/inputcontroller/v1/input_controller.pb.gw.go +++ b/component/inputcontroller/v1/input_controller.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "go.viam.com/api/common/v1" + v1_0 "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -292,7 +292,7 @@ var ( ) func request_InputControllerService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client InputControllerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -325,7 +325,7 @@ func request_InputControllerService_DoCommand_0(ctx context.Context, marshaler r } func local_request_InputControllerService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server InputControllerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -362,7 +362,7 @@ var ( ) func request_InputControllerService_GetGeometries_0(ctx context.Context, marshaler runtime.Marshaler, client InputControllerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.GetGeometriesRequest + var protoReq v1_0.GetGeometriesRequest var metadata runtime.ServerMetadata var ( @@ -395,7 +395,7 @@ func request_InputControllerService_GetGeometries_0(ctx context.Context, marshal } func local_request_InputControllerService_GetGeometries_0(ctx context.Context, marshaler runtime.Marshaler, server InputControllerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.GetGeometriesRequest + var protoReq v1_0.GetGeometriesRequest var metadata runtime.ServerMetadata var ( diff --git a/component/movementsensor/v1/movementsensor.pb.gw.go b/component/movementsensor/v1/movementsensor.pb.gw.go index a2cd12d55..8530c6d94 100644 --- a/component/movementsensor/v1/movementsensor.pb.gw.go +++ b/component/movementsensor/v1/movementsensor.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - v1_0 "go.viam.com/api/common/v1" + "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -597,7 +597,7 @@ var ( ) func request_MovementSensorService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client MovementSensorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.DoCommandRequest + var protoReq v1.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -630,7 +630,7 @@ func request_MovementSensorService_DoCommand_0(ctx context.Context, marshaler ru } func local_request_MovementSensorService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server MovementSensorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.DoCommandRequest + var protoReq v1.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -667,7 +667,7 @@ var ( ) func request_MovementSensorService_GetGeometries_0(ctx context.Context, marshaler runtime.Marshaler, client MovementSensorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.GetGeometriesRequest + var protoReq v1.GetGeometriesRequest var metadata runtime.ServerMetadata var ( @@ -700,7 +700,7 @@ func request_MovementSensorService_GetGeometries_0(ctx context.Context, marshale } func local_request_MovementSensorService_GetGeometries_0(ctx context.Context, marshaler runtime.Marshaler, server MovementSensorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.GetGeometriesRequest + var protoReq v1.GetGeometriesRequest var metadata runtime.ServerMetadata var ( @@ -737,7 +737,7 @@ var ( ) func request_MovementSensorService_GetReadings_0(ctx context.Context, marshaler runtime.Marshaler, client MovementSensorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.GetReadingsRequest + var protoReq v1.GetReadingsRequest var metadata runtime.ServerMetadata var ( @@ -770,7 +770,7 @@ func request_MovementSensorService_GetReadings_0(ctx context.Context, marshaler } func local_request_MovementSensorService_GetReadings_0(ctx context.Context, marshaler runtime.Marshaler, server MovementSensorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.GetReadingsRequest + var protoReq v1.GetReadingsRequest var metadata runtime.ServerMetadata var ( diff --git a/component/posetracker/v1/pose_tracker.pb.gw.go b/component/posetracker/v1/pose_tracker.pb.gw.go index 7eda59b7b..0007c002d 100644 --- a/component/posetracker/v1/pose_tracker.pb.gw.go +++ b/component/posetracker/v1/pose_tracker.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "go.viam.com/api/common/v1" + v1_0 "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -107,7 +107,7 @@ var ( ) func request_PoseTrackerService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client PoseTrackerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -140,7 +140,7 @@ func request_PoseTrackerService_DoCommand_0(ctx context.Context, marshaler runti } func local_request_PoseTrackerService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server PoseTrackerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -177,7 +177,7 @@ var ( ) func request_PoseTrackerService_GetGeometries_0(ctx context.Context, marshaler runtime.Marshaler, client PoseTrackerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.GetGeometriesRequest + var protoReq v1_0.GetGeometriesRequest var metadata runtime.ServerMetadata var ( @@ -210,7 +210,7 @@ func request_PoseTrackerService_GetGeometries_0(ctx context.Context, marshaler r } func local_request_PoseTrackerService_GetGeometries_0(ctx context.Context, marshaler runtime.Marshaler, server PoseTrackerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.GetGeometriesRequest + var protoReq v1_0.GetGeometriesRequest var metadata runtime.ServerMetadata var ( diff --git a/component/powersensor/v1/powersensor.pb.gw.go b/component/powersensor/v1/powersensor.pb.gw.go index c60c7e312..9a80a7e4a 100644 --- a/component/powersensor/v1/powersensor.pb.gw.go +++ b/component/powersensor/v1/powersensor.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "go.viam.com/api/common/v1" + v1_0 "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -247,7 +247,7 @@ var ( ) func request_PowerSensorService_GetReadings_0(ctx context.Context, marshaler runtime.Marshaler, client PowerSensorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.GetReadingsRequest + var protoReq v1_0.GetReadingsRequest var metadata runtime.ServerMetadata var ( @@ -280,7 +280,7 @@ func request_PowerSensorService_GetReadings_0(ctx context.Context, marshaler run } func local_request_PowerSensorService_GetReadings_0(ctx context.Context, marshaler runtime.Marshaler, server PowerSensorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.GetReadingsRequest + var protoReq v1_0.GetReadingsRequest var metadata runtime.ServerMetadata var ( @@ -317,7 +317,7 @@ var ( ) func request_PowerSensorService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client PowerSensorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -350,7 +350,7 @@ func request_PowerSensorService_DoCommand_0(ctx context.Context, marshaler runti } func local_request_PowerSensorService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server PowerSensorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( diff --git a/gen/js/stream/v1/stream_grpc_web_pb.js b/gen/js/stream/v1/stream_grpc_web_pb.js new file mode 100644 index 000000000..009166883 --- /dev/null +++ b/gen/js/stream/v1/stream_grpc_web_pb.js @@ -0,0 +1,263 @@ +/** + * @fileoverview gRPC-Web generated client stub for proto.stream.v1 + * @enhanceable + * @public + */ + +// Code generated by protoc-gen-grpc-web. DO NOT EDIT. +// versions: +// protoc-gen-grpc-web v1.4.2 +// protoc v0.0.0 +// source: stream/v1/stream.proto + + +/* eslint-disable */ +// @ts-nocheck + + + +const grpc = {}; +grpc.web = require('grpc-web'); + +const proto = {}; +proto.proto = {}; +proto.proto.stream = {}; +proto.proto.stream.v1 = require('./stream_pb.js'); + +/** + * @param {string} hostname + * @param {?Object} credentials + * @param {?grpc.web.ClientOptions} options + * @constructor + * @struct + * @final + */ +proto.proto.stream.v1.StreamServiceClient = + function(hostname, credentials, options) { + if (!options) options = {}; + options.format = 'text'; + + /** + * @private @const {!grpc.web.GrpcWebClientBase} The client + */ + this.client_ = new grpc.web.GrpcWebClientBase(options); + + /** + * @private @const {string} The hostname + */ + this.hostname_ = hostname.replace(/\/+$/, ''); + +}; + + +/** + * @param {string} hostname + * @param {?Object} credentials + * @param {?grpc.web.ClientOptions} options + * @constructor + * @struct + * @final + */ +proto.proto.stream.v1.StreamServicePromiseClient = + function(hostname, credentials, options) { + if (!options) options = {}; + options.format = 'text'; + + /** + * @private @const {!grpc.web.GrpcWebClientBase} The client + */ + this.client_ = new grpc.web.GrpcWebClientBase(options); + + /** + * @private @const {string} The hostname + */ + this.hostname_ = hostname.replace(/\/+$/, ''); + +}; + + +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.proto.stream.v1.ListStreamsRequest, + * !proto.proto.stream.v1.ListStreamsResponse>} + */ +const methodDescriptor_StreamService_ListStreams = new grpc.web.MethodDescriptor( + '/proto.stream.v1.StreamService/ListStreams', + grpc.web.MethodType.UNARY, + proto.proto.stream.v1.ListStreamsRequest, + proto.proto.stream.v1.ListStreamsResponse, + /** + * @param {!proto.proto.stream.v1.ListStreamsRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.proto.stream.v1.ListStreamsResponse.deserializeBinary +); + + +/** + * @param {!proto.proto.stream.v1.ListStreamsRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.proto.stream.v1.ListStreamsResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.proto.stream.v1.StreamServiceClient.prototype.listStreams = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/proto.stream.v1.StreamService/ListStreams', + request, + metadata || {}, + methodDescriptor_StreamService_ListStreams, + callback); +}; + + +/** + * @param {!proto.proto.stream.v1.ListStreamsRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.proto.stream.v1.StreamServicePromiseClient.prototype.listStreams = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/proto.stream.v1.StreamService/ListStreams', + request, + metadata || {}, + methodDescriptor_StreamService_ListStreams); +}; + + +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.proto.stream.v1.AddStreamRequest, + * !proto.proto.stream.v1.AddStreamResponse>} + */ +const methodDescriptor_StreamService_AddStream = new grpc.web.MethodDescriptor( + '/proto.stream.v1.StreamService/AddStream', + grpc.web.MethodType.UNARY, + proto.proto.stream.v1.AddStreamRequest, + proto.proto.stream.v1.AddStreamResponse, + /** + * @param {!proto.proto.stream.v1.AddStreamRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.proto.stream.v1.AddStreamResponse.deserializeBinary +); + + +/** + * @param {!proto.proto.stream.v1.AddStreamRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.proto.stream.v1.AddStreamResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.proto.stream.v1.StreamServiceClient.prototype.addStream = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/proto.stream.v1.StreamService/AddStream', + request, + metadata || {}, + methodDescriptor_StreamService_AddStream, + callback); +}; + + +/** + * @param {!proto.proto.stream.v1.AddStreamRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.proto.stream.v1.StreamServicePromiseClient.prototype.addStream = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/proto.stream.v1.StreamService/AddStream', + request, + metadata || {}, + methodDescriptor_StreamService_AddStream); +}; + + +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.proto.stream.v1.RemoveStreamRequest, + * !proto.proto.stream.v1.RemoveStreamResponse>} + */ +const methodDescriptor_StreamService_RemoveStream = new grpc.web.MethodDescriptor( + '/proto.stream.v1.StreamService/RemoveStream', + grpc.web.MethodType.UNARY, + proto.proto.stream.v1.RemoveStreamRequest, + proto.proto.stream.v1.RemoveStreamResponse, + /** + * @param {!proto.proto.stream.v1.RemoveStreamRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.proto.stream.v1.RemoveStreamResponse.deserializeBinary +); + + +/** + * @param {!proto.proto.stream.v1.RemoveStreamRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.proto.stream.v1.RemoveStreamResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.proto.stream.v1.StreamServiceClient.prototype.removeStream = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/proto.stream.v1.StreamService/RemoveStream', + request, + metadata || {}, + methodDescriptor_StreamService_RemoveStream, + callback); +}; + + +/** + * @param {!proto.proto.stream.v1.RemoveStreamRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.proto.stream.v1.StreamServicePromiseClient.prototype.removeStream = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/proto.stream.v1.StreamService/RemoveStream', + request, + metadata || {}, + methodDescriptor_StreamService_RemoveStream); +}; + + +module.exports = proto.proto.stream.v1; + diff --git a/gen/js/stream/v1/stream_pb.d.ts b/gen/js/stream/v1/stream_pb.d.ts new file mode 100644 index 000000000..c4701aab6 --- /dev/null +++ b/gen/js/stream/v1/stream_pb.d.ts @@ -0,0 +1,115 @@ +// package: proto.stream.v1 +// file: stream/v1/stream.proto + +import * as jspb from "google-protobuf"; + +export class ListStreamsRequest extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListStreamsRequest.AsObject; + static toObject(includeInstance: boolean, msg: ListStreamsRequest): ListStreamsRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListStreamsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListStreamsRequest; + static deserializeBinaryFromReader(message: ListStreamsRequest, reader: jspb.BinaryReader): ListStreamsRequest; +} + +export namespace ListStreamsRequest { + export type AsObject = { + } +} + +export class ListStreamsResponse extends jspb.Message { + clearNamesList(): void; + getNamesList(): Array; + setNamesList(value: Array): void; + addNames(value: string, index?: number): string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ListStreamsResponse.AsObject; + static toObject(includeInstance: boolean, msg: ListStreamsResponse): ListStreamsResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ListStreamsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ListStreamsResponse; + static deserializeBinaryFromReader(message: ListStreamsResponse, reader: jspb.BinaryReader): ListStreamsResponse; +} + +export namespace ListStreamsResponse { + export type AsObject = { + namesList: Array, + } +} + +export class AddStreamRequest extends jspb.Message { + getName(): string; + setName(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AddStreamRequest.AsObject; + static toObject(includeInstance: boolean, msg: AddStreamRequest): AddStreamRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AddStreamRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AddStreamRequest; + static deserializeBinaryFromReader(message: AddStreamRequest, reader: jspb.BinaryReader): AddStreamRequest; +} + +export namespace AddStreamRequest { + export type AsObject = { + name: string, + } +} + +export class AddStreamResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AddStreamResponse.AsObject; + static toObject(includeInstance: boolean, msg: AddStreamResponse): AddStreamResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AddStreamResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AddStreamResponse; + static deserializeBinaryFromReader(message: AddStreamResponse, reader: jspb.BinaryReader): AddStreamResponse; +} + +export namespace AddStreamResponse { + export type AsObject = { + } +} + +export class RemoveStreamRequest extends jspb.Message { + getName(): string; + setName(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): RemoveStreamRequest.AsObject; + static toObject(includeInstance: boolean, msg: RemoveStreamRequest): RemoveStreamRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: RemoveStreamRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): RemoveStreamRequest; + static deserializeBinaryFromReader(message: RemoveStreamRequest, reader: jspb.BinaryReader): RemoveStreamRequest; +} + +export namespace RemoveStreamRequest { + export type AsObject = { + name: string, + } +} + +export class RemoveStreamResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): RemoveStreamResponse.AsObject; + static toObject(includeInstance: boolean, msg: RemoveStreamResponse): RemoveStreamResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: RemoveStreamResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): RemoveStreamResponse; + static deserializeBinaryFromReader(message: RemoveStreamResponse, reader: jspb.BinaryReader): RemoveStreamResponse; +} + +export namespace RemoveStreamResponse { + export type AsObject = { + } +} + diff --git a/gen/js/stream/v1/stream_pb.js b/gen/js/stream/v1/stream_pb.js new file mode 100644 index 000000000..4454a8675 --- /dev/null +++ b/gen/js/stream/v1/stream_pb.js @@ -0,0 +1,869 @@ +// source: stream/v1/stream.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = (function() { return this || window || global || self || Function('return this')(); }).call(null); + +goog.exportSymbol('proto.proto.stream.v1.AddStreamRequest', null, global); +goog.exportSymbol('proto.proto.stream.v1.AddStreamResponse', null, global); +goog.exportSymbol('proto.proto.stream.v1.ListStreamsRequest', null, global); +goog.exportSymbol('proto.proto.stream.v1.ListStreamsResponse', null, global); +goog.exportSymbol('proto.proto.stream.v1.RemoveStreamRequest', null, global); +goog.exportSymbol('proto.proto.stream.v1.RemoveStreamResponse', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.proto.stream.v1.ListStreamsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.proto.stream.v1.ListStreamsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.proto.stream.v1.ListStreamsRequest.displayName = 'proto.proto.stream.v1.ListStreamsRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.proto.stream.v1.ListStreamsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.proto.stream.v1.ListStreamsResponse.repeatedFields_, null); +}; +goog.inherits(proto.proto.stream.v1.ListStreamsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.proto.stream.v1.ListStreamsResponse.displayName = 'proto.proto.stream.v1.ListStreamsResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.proto.stream.v1.AddStreamRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.proto.stream.v1.AddStreamRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.proto.stream.v1.AddStreamRequest.displayName = 'proto.proto.stream.v1.AddStreamRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.proto.stream.v1.AddStreamResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.proto.stream.v1.AddStreamResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.proto.stream.v1.AddStreamResponse.displayName = 'proto.proto.stream.v1.AddStreamResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.proto.stream.v1.RemoveStreamRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.proto.stream.v1.RemoveStreamRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.proto.stream.v1.RemoveStreamRequest.displayName = 'proto.proto.stream.v1.RemoveStreamRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.proto.stream.v1.RemoveStreamResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.proto.stream.v1.RemoveStreamResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.proto.stream.v1.RemoveStreamResponse.displayName = 'proto.proto.stream.v1.RemoveStreamResponse'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.proto.stream.v1.ListStreamsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.proto.stream.v1.ListStreamsRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.proto.stream.v1.ListStreamsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.stream.v1.ListStreamsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.proto.stream.v1.ListStreamsRequest} + */ +proto.proto.stream.v1.ListStreamsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.proto.stream.v1.ListStreamsRequest; + return proto.proto.stream.v1.ListStreamsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.proto.stream.v1.ListStreamsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.proto.stream.v1.ListStreamsRequest} + */ +proto.proto.stream.v1.ListStreamsRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.proto.stream.v1.ListStreamsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.proto.stream.v1.ListStreamsRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.proto.stream.v1.ListStreamsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.stream.v1.ListStreamsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.proto.stream.v1.ListStreamsResponse.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.proto.stream.v1.ListStreamsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.proto.stream.v1.ListStreamsResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.proto.stream.v1.ListStreamsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.stream.v1.ListStreamsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + namesList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.proto.stream.v1.ListStreamsResponse} + */ +proto.proto.stream.v1.ListStreamsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.proto.stream.v1.ListStreamsResponse; + return proto.proto.stream.v1.ListStreamsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.proto.stream.v1.ListStreamsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.proto.stream.v1.ListStreamsResponse} + */ +proto.proto.stream.v1.ListStreamsResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.addNames(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.proto.stream.v1.ListStreamsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.proto.stream.v1.ListStreamsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.proto.stream.v1.ListStreamsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.stream.v1.ListStreamsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getNamesList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string names = 1; + * @return {!Array} + */ +proto.proto.stream.v1.ListStreamsResponse.prototype.getNamesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.proto.stream.v1.ListStreamsResponse} returns this + */ +proto.proto.stream.v1.ListStreamsResponse.prototype.setNamesList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.proto.stream.v1.ListStreamsResponse} returns this + */ +proto.proto.stream.v1.ListStreamsResponse.prototype.addNames = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.proto.stream.v1.ListStreamsResponse} returns this + */ +proto.proto.stream.v1.ListStreamsResponse.prototype.clearNamesList = function() { + return this.setNamesList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.proto.stream.v1.AddStreamRequest.prototype.toObject = function(opt_includeInstance) { + return proto.proto.stream.v1.AddStreamRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.proto.stream.v1.AddStreamRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.stream.v1.AddStreamRequest.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.proto.stream.v1.AddStreamRequest} + */ +proto.proto.stream.v1.AddStreamRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.proto.stream.v1.AddStreamRequest; + return proto.proto.stream.v1.AddStreamRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.proto.stream.v1.AddStreamRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.proto.stream.v1.AddStreamRequest} + */ +proto.proto.stream.v1.AddStreamRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.proto.stream.v1.AddStreamRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.proto.stream.v1.AddStreamRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.proto.stream.v1.AddStreamRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.stream.v1.AddStreamRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.proto.stream.v1.AddStreamRequest.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.proto.stream.v1.AddStreamRequest} returns this + */ +proto.proto.stream.v1.AddStreamRequest.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.proto.stream.v1.AddStreamResponse.prototype.toObject = function(opt_includeInstance) { + return proto.proto.stream.v1.AddStreamResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.proto.stream.v1.AddStreamResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.stream.v1.AddStreamResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.proto.stream.v1.AddStreamResponse} + */ +proto.proto.stream.v1.AddStreamResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.proto.stream.v1.AddStreamResponse; + return proto.proto.stream.v1.AddStreamResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.proto.stream.v1.AddStreamResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.proto.stream.v1.AddStreamResponse} + */ +proto.proto.stream.v1.AddStreamResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.proto.stream.v1.AddStreamResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.proto.stream.v1.AddStreamResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.proto.stream.v1.AddStreamResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.stream.v1.AddStreamResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.proto.stream.v1.RemoveStreamRequest.prototype.toObject = function(opt_includeInstance) { + return proto.proto.stream.v1.RemoveStreamRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.proto.stream.v1.RemoveStreamRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.stream.v1.RemoveStreamRequest.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.proto.stream.v1.RemoveStreamRequest} + */ +proto.proto.stream.v1.RemoveStreamRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.proto.stream.v1.RemoveStreamRequest; + return proto.proto.stream.v1.RemoveStreamRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.proto.stream.v1.RemoveStreamRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.proto.stream.v1.RemoveStreamRequest} + */ +proto.proto.stream.v1.RemoveStreamRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.proto.stream.v1.RemoveStreamRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.proto.stream.v1.RemoveStreamRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.proto.stream.v1.RemoveStreamRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.stream.v1.RemoveStreamRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.proto.stream.v1.RemoveStreamRequest.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.proto.stream.v1.RemoveStreamRequest} returns this + */ +proto.proto.stream.v1.RemoveStreamRequest.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.proto.stream.v1.RemoveStreamResponse.prototype.toObject = function(opt_includeInstance) { + return proto.proto.stream.v1.RemoveStreamResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.proto.stream.v1.RemoveStreamResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.stream.v1.RemoveStreamResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.proto.stream.v1.RemoveStreamResponse} + */ +proto.proto.stream.v1.RemoveStreamResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.proto.stream.v1.RemoveStreamResponse; + return proto.proto.stream.v1.RemoveStreamResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.proto.stream.v1.RemoveStreamResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.proto.stream.v1.RemoveStreamResponse} + */ +proto.proto.stream.v1.RemoveStreamResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.proto.stream.v1.RemoveStreamResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.proto.stream.v1.RemoveStreamResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.proto.stream.v1.RemoveStreamResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.proto.stream.v1.RemoveStreamResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + +goog.object.extend(exports, proto.proto.stream.v1); diff --git a/gen/js/stream/v1/stream_pb_service.d.ts b/gen/js/stream/v1/stream_pb_service.d.ts new file mode 100644 index 000000000..b2dbd615f --- /dev/null +++ b/gen/js/stream/v1/stream_pb_service.d.ts @@ -0,0 +1,101 @@ +// package: proto.stream.v1 +// file: stream/v1/stream.proto + +import * as stream_v1_stream_pb from "../../stream/v1/stream_pb"; +import {grpc} from "@improbable-eng/grpc-web"; + +type StreamServiceListStreams = { + readonly methodName: string; + readonly service: typeof StreamService; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof stream_v1_stream_pb.ListStreamsRequest; + readonly responseType: typeof stream_v1_stream_pb.ListStreamsResponse; +}; + +type StreamServiceAddStream = { + readonly methodName: string; + readonly service: typeof StreamService; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof stream_v1_stream_pb.AddStreamRequest; + readonly responseType: typeof stream_v1_stream_pb.AddStreamResponse; +}; + +type StreamServiceRemoveStream = { + readonly methodName: string; + readonly service: typeof StreamService; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof stream_v1_stream_pb.RemoveStreamRequest; + readonly responseType: typeof stream_v1_stream_pb.RemoveStreamResponse; +}; + +export class StreamService { + static readonly serviceName: string; + static readonly ListStreams: StreamServiceListStreams; + static readonly AddStream: StreamServiceAddStream; + static readonly RemoveStream: StreamServiceRemoveStream; +} + +export type ServiceError = { message: string, code: number; metadata: grpc.Metadata } +export type Status = { details: string, code: number; metadata: grpc.Metadata } + +interface UnaryResponse { + cancel(): void; +} +interface ResponseStream { + cancel(): void; + on(type: 'data', handler: (message: T) => void): ResponseStream; + on(type: 'end', handler: (status?: Status) => void): ResponseStream; + on(type: 'status', handler: (status: Status) => void): ResponseStream; +} +interface RequestStream { + write(message: T): RequestStream; + end(): void; + cancel(): void; + on(type: 'end', handler: (status?: Status) => void): RequestStream; + on(type: 'status', handler: (status: Status) => void): RequestStream; +} +interface BidirectionalStream { + write(message: ReqT): BidirectionalStream; + end(): void; + cancel(): void; + on(type: 'data', handler: (message: ResT) => void): BidirectionalStream; + on(type: 'end', handler: (status?: Status) => void): BidirectionalStream; + on(type: 'status', handler: (status: Status) => void): BidirectionalStream; +} + +export class StreamServiceClient { + readonly serviceHost: string; + + constructor(serviceHost: string, options?: grpc.RpcOptions); + listStreams( + requestMessage: stream_v1_stream_pb.ListStreamsRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: stream_v1_stream_pb.ListStreamsResponse|null) => void + ): UnaryResponse; + listStreams( + requestMessage: stream_v1_stream_pb.ListStreamsRequest, + callback: (error: ServiceError|null, responseMessage: stream_v1_stream_pb.ListStreamsResponse|null) => void + ): UnaryResponse; + addStream( + requestMessage: stream_v1_stream_pb.AddStreamRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: stream_v1_stream_pb.AddStreamResponse|null) => void + ): UnaryResponse; + addStream( + requestMessage: stream_v1_stream_pb.AddStreamRequest, + callback: (error: ServiceError|null, responseMessage: stream_v1_stream_pb.AddStreamResponse|null) => void + ): UnaryResponse; + removeStream( + requestMessage: stream_v1_stream_pb.RemoveStreamRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: stream_v1_stream_pb.RemoveStreamResponse|null) => void + ): UnaryResponse; + removeStream( + requestMessage: stream_v1_stream_pb.RemoveStreamRequest, + callback: (error: ServiceError|null, responseMessage: stream_v1_stream_pb.RemoveStreamResponse|null) => void + ): UnaryResponse; +} + diff --git a/gen/js/stream/v1/stream_pb_service.js b/gen/js/stream/v1/stream_pb_service.js new file mode 100644 index 000000000..d9d1a544d --- /dev/null +++ b/gen/js/stream/v1/stream_pb_service.js @@ -0,0 +1,141 @@ +// package: proto.stream.v1 +// file: stream/v1/stream.proto + +var stream_v1_stream_pb = require("../../stream/v1/stream_pb"); +var grpc = require("@improbable-eng/grpc-web").grpc; + +var StreamService = (function () { + function StreamService() {} + StreamService.serviceName = "proto.stream.v1.StreamService"; + return StreamService; +}()); + +StreamService.ListStreams = { + methodName: "ListStreams", + service: StreamService, + requestStream: false, + responseStream: false, + requestType: stream_v1_stream_pb.ListStreamsRequest, + responseType: stream_v1_stream_pb.ListStreamsResponse +}; + +StreamService.AddStream = { + methodName: "AddStream", + service: StreamService, + requestStream: false, + responseStream: false, + requestType: stream_v1_stream_pb.AddStreamRequest, + responseType: stream_v1_stream_pb.AddStreamResponse +}; + +StreamService.RemoveStream = { + methodName: "RemoveStream", + service: StreamService, + requestStream: false, + responseStream: false, + requestType: stream_v1_stream_pb.RemoveStreamRequest, + responseType: stream_v1_stream_pb.RemoveStreamResponse +}; + +exports.StreamService = StreamService; + +function StreamServiceClient(serviceHost, options) { + this.serviceHost = serviceHost; + this.options = options || {}; +} + +StreamServiceClient.prototype.listStreams = function listStreams(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(StreamService.ListStreams, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + +StreamServiceClient.prototype.addStream = function addStream(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(StreamService.AddStream, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + +StreamServiceClient.prototype.removeStream = function removeStream(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(StreamService.RemoveStream, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + +exports.StreamServiceClient = StreamServiceClient; + diff --git a/proto/viam/stream/v1/stream.proto b/proto/viam/stream/v1/stream.proto new file mode 100644 index 000000000..2995b7c6a --- /dev/null +++ b/proto/viam/stream/v1/stream.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; + +package proto.stream.v1; + +option go_package = "github.com/edaniels/gostream/proto/stream/v1"; + +// A StreamService is used to coordinate with a WebRTC the listing, +// addition, and removal of registered video streams. +// TODO(https://github.com/viamrobotics/rdk/issues/509): support removal +service StreamService { + // ListStreams returns all streams registered. + rpc ListStreams(ListStreamsRequest) returns (ListStreamsResponse); + + // AddStream requests a particular stream be added. + rpc AddStream(AddStreamRequest) returns (AddStreamResponse); + + // RemoveStream requests a particular stream be removed. If the calling client + // is the last to be receiving the stream, it will attempt to be stopped to + // conserve resources. + rpc RemoveStream(RemoveStreamRequest) returns (RemoveStreamResponse); +} + +// ListStreamsRequest requests all streams registered. +message ListStreamsRequest {} + +// A ListStreamsResponse details streams registered. +message ListStreamsResponse { + repeated string names = 1; +} + +// A AddStreamRequest requests the given stream be added to the connection. +message AddStreamRequest { + string name = 1; +} + +// AddStreamResponse is returned after a successful AddStreamRequest. +message AddStreamResponse {} + +// A RemoveStreamRequest requests the given stream be removed from the connection. +message RemoveStreamRequest { + string name = 1; +} + +// RemoveStreamResponse is returned after a successful RemoveStreamRequest. +message RemoveStreamResponse {} diff --git a/service/motion/v1/motion.pb.gw.go b/service/motion/v1/motion.pb.gw.go index 91bc2a4b0..aa33b532f 100644 --- a/service/motion/v1/motion.pb.gw.go +++ b/service/motion/v1/motion.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - v1_0 "go.viam.com/api/common/v1" + "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -597,7 +597,7 @@ var ( ) func request_MotionService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client MotionServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.DoCommandRequest + var protoReq v1.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -630,7 +630,7 @@ func request_MotionService_DoCommand_0(ctx context.Context, marshaler runtime.Ma } func local_request_MotionService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server MotionServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_0.DoCommandRequest + var protoReq v1.DoCommandRequest var metadata runtime.ServerMetadata var ( diff --git a/service/navigation/v1/navigation.pb.gw.go b/service/navigation/v1/navigation.pb.gw.go index 71526c478..e95f24696 100644 --- a/service/navigation/v1/navigation.pb.gw.go +++ b/service/navigation/v1/navigation.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "go.viam.com/api/common/v1" + v1_0 "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -617,7 +617,7 @@ var ( ) func request_NavigationService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client NavigationServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -650,7 +650,7 @@ func request_NavigationService_DoCommand_0(ctx context.Context, marshaler runtim } func local_request_NavigationService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server NavigationServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( diff --git a/service/sensors/v1/sensors.pb.gw.go b/service/sensors/v1/sensors.pb.gw.go index b0c69d02f..9fc2a2808 100644 --- a/service/sensors/v1/sensors.pb.gw.go +++ b/service/sensors/v1/sensors.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "go.viam.com/api/common/v1" + v1_0 "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -177,7 +177,7 @@ var ( ) func request_SensorsService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client SensorsServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -210,7 +210,7 @@ func request_SensorsService_DoCommand_0(ctx context.Context, marshaler runtime.M } func local_request_SensorsService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server SensorsServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( diff --git a/service/shell/v1/shell.pb.gw.go b/service/shell/v1/shell.pb.gw.go index ebf18f880..69eff6cda 100644 --- a/service/shell/v1/shell.pb.gw.go +++ b/service/shell/v1/shell.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "go.viam.com/api/common/v1" + v1_0 "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -80,7 +80,7 @@ var ( ) func request_ShellService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client ShellServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -113,7 +113,7 @@ func request_ShellService_DoCommand_0(ctx context.Context, marshaler runtime.Mar } func local_request_ShellService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server ShellServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( diff --git a/service/slam/v1/slam.pb.gw.go b/service/slam/v1/slam.pb.gw.go index a26deb244..7803f2636 100644 --- a/service/slam/v1/slam.pb.gw.go +++ b/service/slam/v1/slam.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "go.viam.com/api/common/v1" + v1_0 "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -209,7 +209,7 @@ var ( ) func request_SLAMService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client SLAMServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -242,7 +242,7 @@ func request_SLAMService_DoCommand_0(ctx context.Context, marshaler runtime.Mars } func local_request_SLAMService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server SLAMServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_0.DoCommandRequest var metadata runtime.ServerMetadata var ( diff --git a/stream/v1/stream.pb.go b/stream/v1/stream.pb.go new file mode 100644 index 000000000..8e037ea86 --- /dev/null +++ b/stream/v1/stream.pb.go @@ -0,0 +1,458 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc (unknown) +// source: stream/v1/stream.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ListStreamsRequest requests all streams registered. +type ListStreamsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListStreamsRequest) Reset() { + *x = ListStreamsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_stream_v1_stream_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListStreamsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListStreamsRequest) ProtoMessage() {} + +func (x *ListStreamsRequest) ProtoReflect() protoreflect.Message { + mi := &file_stream_v1_stream_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListStreamsRequest.ProtoReflect.Descriptor instead. +func (*ListStreamsRequest) Descriptor() ([]byte, []int) { + return file_stream_v1_stream_proto_rawDescGZIP(), []int{0} +} + +// A ListStreamsResponse details streams registered. +type ListStreamsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"` +} + +func (x *ListStreamsResponse) Reset() { + *x = ListStreamsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_stream_v1_stream_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListStreamsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListStreamsResponse) ProtoMessage() {} + +func (x *ListStreamsResponse) ProtoReflect() protoreflect.Message { + mi := &file_stream_v1_stream_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListStreamsResponse.ProtoReflect.Descriptor instead. +func (*ListStreamsResponse) Descriptor() ([]byte, []int) { + return file_stream_v1_stream_proto_rawDescGZIP(), []int{1} +} + +func (x *ListStreamsResponse) GetNames() []string { + if x != nil { + return x.Names + } + return nil +} + +// A AddStreamRequest requests the given stream be added to the connection. +type AddStreamRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *AddStreamRequest) Reset() { + *x = AddStreamRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_stream_v1_stream_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddStreamRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddStreamRequest) ProtoMessage() {} + +func (x *AddStreamRequest) ProtoReflect() protoreflect.Message { + mi := &file_stream_v1_stream_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddStreamRequest.ProtoReflect.Descriptor instead. +func (*AddStreamRequest) Descriptor() ([]byte, []int) { + return file_stream_v1_stream_proto_rawDescGZIP(), []int{2} +} + +func (x *AddStreamRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// AddStreamResponse is returned after a successful AddStreamRequest. +type AddStreamResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *AddStreamResponse) Reset() { + *x = AddStreamResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_stream_v1_stream_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddStreamResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddStreamResponse) ProtoMessage() {} + +func (x *AddStreamResponse) ProtoReflect() protoreflect.Message { + mi := &file_stream_v1_stream_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddStreamResponse.ProtoReflect.Descriptor instead. +func (*AddStreamResponse) Descriptor() ([]byte, []int) { + return file_stream_v1_stream_proto_rawDescGZIP(), []int{3} +} + +// A RemoveStreamRequest requests the given stream be removed from the connection. +type RemoveStreamRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *RemoveStreamRequest) Reset() { + *x = RemoveStreamRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_stream_v1_stream_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveStreamRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveStreamRequest) ProtoMessage() {} + +func (x *RemoveStreamRequest) ProtoReflect() protoreflect.Message { + mi := &file_stream_v1_stream_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveStreamRequest.ProtoReflect.Descriptor instead. +func (*RemoveStreamRequest) Descriptor() ([]byte, []int) { + return file_stream_v1_stream_proto_rawDescGZIP(), []int{4} +} + +func (x *RemoveStreamRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// RemoveStreamResponse is returned after a successful RemoveStreamRequest. +type RemoveStreamResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RemoveStreamResponse) Reset() { + *x = RemoveStreamResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_stream_v1_stream_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveStreamResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveStreamResponse) ProtoMessage() {} + +func (x *RemoveStreamResponse) ProtoReflect() protoreflect.Message { + mi := &file_stream_v1_stream_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveStreamResponse.ProtoReflect.Descriptor instead. +func (*RemoveStreamResponse) Descriptor() ([]byte, []int) { + return file_stream_v1_stream_proto_rawDescGZIP(), []int{5} +} + +var File_stream_v1_stream_proto protoreflect.FileDescriptor + +var file_stream_v1_stream_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x22, 0x14, 0x0a, 0x12, 0x4c, 0x69, 0x73, + 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0x2b, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0x26, 0x0a, 0x10, + 0x41, 0x64, 0x64, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x13, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x0a, 0x13, 0x52, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x16, 0x0a, 0x14, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x9a, 0x02, 0x0a, + 0x0d, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x58, + 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x12, 0x23, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x52, 0x0a, 0x09, 0x41, 0x64, 0x64, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x73, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x53, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x0c, + 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x24, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x52, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x64, 0x61, 0x6e, 0x69, 0x65, 0x6c, 0x73, + 0x2f, 0x67, 0x6f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_stream_v1_stream_proto_rawDescOnce sync.Once + file_stream_v1_stream_proto_rawDescData = file_stream_v1_stream_proto_rawDesc +) + +func file_stream_v1_stream_proto_rawDescGZIP() []byte { + file_stream_v1_stream_proto_rawDescOnce.Do(func() { + file_stream_v1_stream_proto_rawDescData = protoimpl.X.CompressGZIP(file_stream_v1_stream_proto_rawDescData) + }) + return file_stream_v1_stream_proto_rawDescData +} + +var file_stream_v1_stream_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_stream_v1_stream_proto_goTypes = []interface{}{ + (*ListStreamsRequest)(nil), // 0: proto.stream.v1.ListStreamsRequest + (*ListStreamsResponse)(nil), // 1: proto.stream.v1.ListStreamsResponse + (*AddStreamRequest)(nil), // 2: proto.stream.v1.AddStreamRequest + (*AddStreamResponse)(nil), // 3: proto.stream.v1.AddStreamResponse + (*RemoveStreamRequest)(nil), // 4: proto.stream.v1.RemoveStreamRequest + (*RemoveStreamResponse)(nil), // 5: proto.stream.v1.RemoveStreamResponse +} +var file_stream_v1_stream_proto_depIdxs = []int32{ + 0, // 0: proto.stream.v1.StreamService.ListStreams:input_type -> proto.stream.v1.ListStreamsRequest + 2, // 1: proto.stream.v1.StreamService.AddStream:input_type -> proto.stream.v1.AddStreamRequest + 4, // 2: proto.stream.v1.StreamService.RemoveStream:input_type -> proto.stream.v1.RemoveStreamRequest + 1, // 3: proto.stream.v1.StreamService.ListStreams:output_type -> proto.stream.v1.ListStreamsResponse + 3, // 4: proto.stream.v1.StreamService.AddStream:output_type -> proto.stream.v1.AddStreamResponse + 5, // 5: proto.stream.v1.StreamService.RemoveStream:output_type -> proto.stream.v1.RemoveStreamResponse + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_stream_v1_stream_proto_init() } +func file_stream_v1_stream_proto_init() { + if File_stream_v1_stream_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_stream_v1_stream_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListStreamsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_stream_v1_stream_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListStreamsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_stream_v1_stream_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddStreamRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_stream_v1_stream_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddStreamResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_stream_v1_stream_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveStreamRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_stream_v1_stream_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveStreamResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_stream_v1_stream_proto_rawDesc, + NumEnums: 0, + NumMessages: 6, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_stream_v1_stream_proto_goTypes, + DependencyIndexes: file_stream_v1_stream_proto_depIdxs, + MessageInfos: file_stream_v1_stream_proto_msgTypes, + }.Build() + File_stream_v1_stream_proto = out.File + file_stream_v1_stream_proto_rawDesc = nil + file_stream_v1_stream_proto_goTypes = nil + file_stream_v1_stream_proto_depIdxs = nil +} diff --git a/stream/v1/stream.pb.gw.go b/stream/v1/stream.pb.gw.go new file mode 100644 index 000000000..fe28699eb --- /dev/null +++ b/stream/v1/stream.pb.gw.go @@ -0,0 +1,341 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: stream/v1/stream.proto + +/* +Package v1 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package v1 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_StreamService_ListStreams_0(ctx context.Context, marshaler runtime.Marshaler, client StreamServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListStreamsRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListStreams(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_StreamService_ListStreams_0(ctx context.Context, marshaler runtime.Marshaler, server StreamServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListStreamsRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListStreams(ctx, &protoReq) + return msg, metadata, err + +} + +func request_StreamService_AddStream_0(ctx context.Context, marshaler runtime.Marshaler, client StreamServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddStreamRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AddStream(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_StreamService_AddStream_0(ctx context.Context, marshaler runtime.Marshaler, server StreamServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddStreamRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AddStream(ctx, &protoReq) + return msg, metadata, err + +} + +func request_StreamService_RemoveStream_0(ctx context.Context, marshaler runtime.Marshaler, client StreamServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RemoveStreamRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RemoveStream(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_StreamService_RemoveStream_0(ctx context.Context, marshaler runtime.Marshaler, server StreamServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RemoveStreamRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RemoveStream(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterStreamServiceHandlerServer registers the http handlers for service StreamService to "mux". +// UnaryRPC :call StreamServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterStreamServiceHandlerFromEndpoint instead. +func RegisterStreamServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server StreamServiceServer) error { + + mux.Handle("POST", pattern_StreamService_ListStreams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/proto.stream.v1.StreamService/ListStreams", runtime.WithHTTPPathPattern("/proto.stream.v1.StreamService/ListStreams")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_StreamService_ListStreams_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StreamService_ListStreams_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_StreamService_AddStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/proto.stream.v1.StreamService/AddStream", runtime.WithHTTPPathPattern("/proto.stream.v1.StreamService/AddStream")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_StreamService_AddStream_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StreamService_AddStream_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_StreamService_RemoveStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/proto.stream.v1.StreamService/RemoveStream", runtime.WithHTTPPathPattern("/proto.stream.v1.StreamService/RemoveStream")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_StreamService_RemoveStream_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StreamService_RemoveStream_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterStreamServiceHandlerFromEndpoint is same as RegisterStreamServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterStreamServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterStreamServiceHandler(ctx, mux, conn) +} + +// RegisterStreamServiceHandler registers the http handlers for service StreamService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterStreamServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterStreamServiceHandlerClient(ctx, mux, NewStreamServiceClient(conn)) +} + +// RegisterStreamServiceHandlerClient registers the http handlers for service StreamService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "StreamServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "StreamServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "StreamServiceClient" to call the correct interceptors. +func RegisterStreamServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client StreamServiceClient) error { + + mux.Handle("POST", pattern_StreamService_ListStreams_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/proto.stream.v1.StreamService/ListStreams", runtime.WithHTTPPathPattern("/proto.stream.v1.StreamService/ListStreams")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_StreamService_ListStreams_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StreamService_ListStreams_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_StreamService_AddStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/proto.stream.v1.StreamService/AddStream", runtime.WithHTTPPathPattern("/proto.stream.v1.StreamService/AddStream")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_StreamService_AddStream_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StreamService_AddStream_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_StreamService_RemoveStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/proto.stream.v1.StreamService/RemoveStream", runtime.WithHTTPPathPattern("/proto.stream.v1.StreamService/RemoveStream")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_StreamService_RemoveStream_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_StreamService_RemoveStream_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_StreamService_ListStreams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"proto.stream.v1.StreamService", "ListStreams"}, "")) + + pattern_StreamService_AddStream_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"proto.stream.v1.StreamService", "AddStream"}, "")) + + pattern_StreamService_RemoveStream_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"proto.stream.v1.StreamService", "RemoveStream"}, "")) +) + +var ( + forward_StreamService_ListStreams_0 = runtime.ForwardResponseMessage + + forward_StreamService_AddStream_0 = runtime.ForwardResponseMessage + + forward_StreamService_RemoveStream_0 = runtime.ForwardResponseMessage +) diff --git a/stream/v1/stream_grpc.pb.go b/stream/v1/stream_grpc.pb.go new file mode 100644 index 000000000..6548c198d --- /dev/null +++ b/stream/v1/stream_grpc.pb.go @@ -0,0 +1,187 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: stream/v1/stream.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// StreamServiceClient is the client API for StreamService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type StreamServiceClient interface { + // ListStreams returns all streams registered. + ListStreams(ctx context.Context, in *ListStreamsRequest, opts ...grpc.CallOption) (*ListStreamsResponse, error) + // AddStream requests a particular stream be added. + AddStream(ctx context.Context, in *AddStreamRequest, opts ...grpc.CallOption) (*AddStreamResponse, error) + // RemoveStream requests a particular stream be removed. If the calling client + // is the last to be receiving the stream, it will attempt to be stopped to + // conserve resources. + RemoveStream(ctx context.Context, in *RemoveStreamRequest, opts ...grpc.CallOption) (*RemoveStreamResponse, error) +} + +type streamServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewStreamServiceClient(cc grpc.ClientConnInterface) StreamServiceClient { + return &streamServiceClient{cc} +} + +func (c *streamServiceClient) ListStreams(ctx context.Context, in *ListStreamsRequest, opts ...grpc.CallOption) (*ListStreamsResponse, error) { + out := new(ListStreamsResponse) + err := c.cc.Invoke(ctx, "/proto.stream.v1.StreamService/ListStreams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streamServiceClient) AddStream(ctx context.Context, in *AddStreamRequest, opts ...grpc.CallOption) (*AddStreamResponse, error) { + out := new(AddStreamResponse) + err := c.cc.Invoke(ctx, "/proto.stream.v1.StreamService/AddStream", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *streamServiceClient) RemoveStream(ctx context.Context, in *RemoveStreamRequest, opts ...grpc.CallOption) (*RemoveStreamResponse, error) { + out := new(RemoveStreamResponse) + err := c.cc.Invoke(ctx, "/proto.stream.v1.StreamService/RemoveStream", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// StreamServiceServer is the server API for StreamService service. +// All implementations must embed UnimplementedStreamServiceServer +// for forward compatibility +type StreamServiceServer interface { + // ListStreams returns all streams registered. + ListStreams(context.Context, *ListStreamsRequest) (*ListStreamsResponse, error) + // AddStream requests a particular stream be added. + AddStream(context.Context, *AddStreamRequest) (*AddStreamResponse, error) + // RemoveStream requests a particular stream be removed. If the calling client + // is the last to be receiving the stream, it will attempt to be stopped to + // conserve resources. + RemoveStream(context.Context, *RemoveStreamRequest) (*RemoveStreamResponse, error) + mustEmbedUnimplementedStreamServiceServer() +} + +// UnimplementedStreamServiceServer must be embedded to have forward compatible implementations. +type UnimplementedStreamServiceServer struct { +} + +func (UnimplementedStreamServiceServer) ListStreams(context.Context, *ListStreamsRequest) (*ListStreamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListStreams not implemented") +} +func (UnimplementedStreamServiceServer) AddStream(context.Context, *AddStreamRequest) (*AddStreamResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddStream not implemented") +} +func (UnimplementedStreamServiceServer) RemoveStream(context.Context, *RemoveStreamRequest) (*RemoveStreamResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveStream not implemented") +} +func (UnimplementedStreamServiceServer) mustEmbedUnimplementedStreamServiceServer() {} + +// UnsafeStreamServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to StreamServiceServer will +// result in compilation errors. +type UnsafeStreamServiceServer interface { + mustEmbedUnimplementedStreamServiceServer() +} + +func RegisterStreamServiceServer(s grpc.ServiceRegistrar, srv StreamServiceServer) { + s.RegisterService(&StreamService_ServiceDesc, srv) +} + +func _StreamService_ListStreams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListStreamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreamServiceServer).ListStreams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.stream.v1.StreamService/ListStreams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreamServiceServer).ListStreams(ctx, req.(*ListStreamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreamService_AddStream_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddStreamRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreamServiceServer).AddStream(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.stream.v1.StreamService/AddStream", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreamServiceServer).AddStream(ctx, req.(*AddStreamRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StreamService_RemoveStream_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveStreamRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StreamServiceServer).RemoveStream(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.stream.v1.StreamService/RemoveStream", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StreamServiceServer).RemoveStream(ctx, req.(*RemoveStreamRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// StreamService_ServiceDesc is the grpc.ServiceDesc for StreamService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var StreamService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "proto.stream.v1.StreamService", + HandlerType: (*StreamServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListStreams", + Handler: _StreamService_ListStreams_Handler, + }, + { + MethodName: "AddStream", + Handler: _StreamService_AddStream_Handler, + }, + { + MethodName: "RemoveStream", + Handler: _StreamService_RemoveStream_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "stream/v1/stream.proto", +}