diff --git a/containerz/containerz.pb.go b/containerz/containerz.pb.go index 178be59..bc585bc 100644 --- a/containerz/containerz.pb.go +++ b/containerz/containerz.pb.go @@ -4114,7 +4114,7 @@ var file_containerz_containerz_proto_rawDesc = []byte{ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x2a, 0x0a, 0x06, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x0e, 0x44, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x53, 0x5f, 0x4c, 0x4f, 0x43, 0x41, - 0x4c, 0x10, 0x01, 0x32, 0xdb, 0x0b, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x4c, 0x10, 0x01, 0x32, 0xdd, 0x0b, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x12, 0x4f, 0x0a, 0x06, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x12, 0x1e, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, @@ -4196,22 +4196,22 @@ var file_containerz_containerz_proto_rawDesc = []byte{ 0x6f, 0x70, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6c, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5c, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x23, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x12, 0x24, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x42, 0x2f, 0xd2, 0x3e, 0x05, 0x30, 0x2e, 0x31, 0x2e, 0x32, 0x5a, 0x25, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x7a, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0x00, 0x30, 0x01, 0x12, 0x5d, 0x0a, 0x0c, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x12, 0x24, 0x2e, 0x67, 0x6e, 0x6f, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x6e, 0x6f, + 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x7a, 0x2e, 0x52, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x42, 0x2f, 0xd2, 0x3e, 0x05, 0x30, 0x2e, 0x31, 0x2e, 0x32, 0x5a, 0x25, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x6e, 0x6f, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x7a, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/containerz/containerz.proto b/containerz/containerz.proto index 953aa3b..406d4c3 100644 --- a/containerz/containerz.proto +++ b/containerz/containerz.proto @@ -131,7 +131,7 @@ service Containerz { rpc StopPlugin(StopPluginRequest) returns (StopPluginResponse) {} // ListPlugins lists the plugins as specified by the request. - rpc ListPlugins(ListPluginsRequest) returns (ListPluginsResponse) {} + rpc ListPlugins(ListPluginsRequest) returns (stream ListPluginsResponse) {} // RemovePlugin deletes the plugin from the system. If the plugin // does not exist this operation is a no-op. diff --git a/containerz/containerz_grpc.pb.go b/containerz/containerz_grpc.pb.go index 916366b..392ba5c 100644 --- a/containerz/containerz_grpc.pb.go +++ b/containerz/containerz_grpc.pb.go @@ -36,7 +36,7 @@ type ContainerzClient interface { ListVolume(ctx context.Context, in *ListVolumeRequest, opts ...grpc.CallOption) (Containerz_ListVolumeClient, error) StartPlugin(ctx context.Context, in *StartPluginRequest, opts ...grpc.CallOption) (*StartPluginResponse, error) StopPlugin(ctx context.Context, in *StopPluginRequest, opts ...grpc.CallOption) (*StopPluginResponse, error) - ListPlugins(ctx context.Context, in *ListPluginsRequest, opts ...grpc.CallOption) (*ListPluginsResponse, error) + ListPlugins(ctx context.Context, in *ListPluginsRequest, opts ...grpc.CallOption) (Containerz_ListPluginsClient, error) RemovePlugin(ctx context.Context, in *RemovePluginRequest, opts ...grpc.CallOption) (*RemovePluginResponse, error) } @@ -288,13 +288,36 @@ func (c *containerzClient) StopPlugin(ctx context.Context, in *StopPluginRequest return out, nil } -func (c *containerzClient) ListPlugins(ctx context.Context, in *ListPluginsRequest, opts ...grpc.CallOption) (*ListPluginsResponse, error) { - out := new(ListPluginsResponse) - err := c.cc.Invoke(ctx, "/gnoi.containerz.Containerz/ListPlugins", in, out, opts...) +func (c *containerzClient) ListPlugins(ctx context.Context, in *ListPluginsRequest, opts ...grpc.CallOption) (Containerz_ListPluginsClient, error) { + stream, err := c.cc.NewStream(ctx, &Containerz_ServiceDesc.Streams[5], "/gnoi.containerz.Containerz/ListPlugins", opts...) if err != nil { return nil, err } - return out, nil + x := &containerzListPluginsClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Containerz_ListPluginsClient interface { + Recv() (*ListPluginsResponse, error) + grpc.ClientStream +} + +type containerzListPluginsClient struct { + grpc.ClientStream +} + +func (x *containerzListPluginsClient) Recv() (*ListPluginsResponse, error) { + m := new(ListPluginsResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil } func (c *containerzClient) RemovePlugin(ctx context.Context, in *RemovePluginRequest, opts ...grpc.CallOption) (*RemovePluginResponse, error) { @@ -324,7 +347,7 @@ type ContainerzServer interface { ListVolume(*ListVolumeRequest, Containerz_ListVolumeServer) error StartPlugin(context.Context, *StartPluginRequest) (*StartPluginResponse, error) StopPlugin(context.Context, *StopPluginRequest) (*StopPluginResponse, error) - ListPlugins(context.Context, *ListPluginsRequest) (*ListPluginsResponse, error) + ListPlugins(*ListPluginsRequest, Containerz_ListPluginsServer) error RemovePlugin(context.Context, *RemovePluginRequest) (*RemovePluginResponse, error) mustEmbedUnimplementedContainerzServer() } @@ -375,8 +398,8 @@ func (UnimplementedContainerzServer) StartPlugin(context.Context, *StartPluginRe func (UnimplementedContainerzServer) StopPlugin(context.Context, *StopPluginRequest) (*StopPluginResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StopPlugin not implemented") } -func (UnimplementedContainerzServer) ListPlugins(context.Context, *ListPluginsRequest) (*ListPluginsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListPlugins not implemented") +func (UnimplementedContainerzServer) ListPlugins(*ListPluginsRequest, Containerz_ListPluginsServer) error { + return status.Errorf(codes.Unimplemented, "method ListPlugins not implemented") } func (UnimplementedContainerzServer) RemovePlugin(context.Context, *RemovePluginRequest) (*RemovePluginResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemovePlugin not implemented") @@ -666,22 +689,25 @@ func _Containerz_StopPlugin_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } -func _Containerz_ListPlugins_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListPluginsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ContainerzServer).ListPlugins(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gnoi.containerz.Containerz/ListPlugins", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContainerzServer).ListPlugins(ctx, req.(*ListPluginsRequest)) +func _Containerz_ListPlugins_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ListPluginsRequest) + if err := stream.RecvMsg(m); err != nil { + return err } - return interceptor(ctx, in, info, handler) + return srv.(ContainerzServer).ListPlugins(m, &containerzListPluginsServer{stream}) +} + +type Containerz_ListPluginsServer interface { + Send(*ListPluginsResponse) error + grpc.ServerStream +} + +type containerzListPluginsServer struct { + grpc.ServerStream +} + +func (x *containerzListPluginsServer) Send(m *ListPluginsResponse) error { + return x.ServerStream.SendMsg(m) } func _Containerz_RemovePlugin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -745,10 +771,6 @@ var Containerz_ServiceDesc = grpc.ServiceDesc{ MethodName: "StopPlugin", Handler: _Containerz_StopPlugin_Handler, }, - { - MethodName: "ListPlugins", - Handler: _Containerz_ListPlugins_Handler, - }, { MethodName: "RemovePlugin", Handler: _Containerz_RemovePlugin_Handler, @@ -781,6 +803,11 @@ var Containerz_ServiceDesc = grpc.ServiceDesc{ Handler: _Containerz_ListVolume_Handler, ServerStreams: true, }, + { + StreamName: "ListPlugins", + Handler: _Containerz_ListPlugins_Handler, + ServerStreams: true, + }, }, Metadata: "containerz/containerz.proto", }