| 1 |
// Copyright 2025 Google LLC |
| 2 |
// |
| 3 |
// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
// you may not use this file except in compliance with the License. |
| 5 |
// You may obtain a copy of the License at |
| 6 |
// |
| 7 |
// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
// |
| 9 |
// Unless required by applicable law or agreed to in writing, software |
| 10 |
// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
// See the License for the specific language governing permissions and |
| 13 |
// limitations under the License. |
| 14 |
|
| 15 |
// Code generated by protoc-gen-go. DO NOT EDIT. |
| 16 |
// versions: |
| 17 |
// protoc-gen-go v1.26.0 |
| 18 |
// protoc v4.24.4 |
| 19 |
// source: google/bytestream/bytestream.proto |
| 20 |
|
| 21 |
package bytestream |
| 22 |
|
| 23 |
import ( |
| 24 |
context "context" |
| 25 |
reflect "reflect" |
| 26 |
sync "sync" |
| 27 |
|
| 28 |
grpc "google.golang.org/grpc" |
| 29 |
codes "google.golang.org/grpc/codes" |
| 30 |
status "google.golang.org/grpc/status" |
| 31 |
protoreflect "google.golang.org/protobuf/reflect/protoreflect" |
| 32 |
protoimpl "google.golang.org/protobuf/runtime/protoimpl" |
| 33 |
) |
| 34 |
|
| 35 |
const ( |
| 36 |
// Verify that this generated code is sufficiently up-to-date. |
| 37 |
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) |
| 38 |
// Verify that runtime/protoimpl is sufficiently up-to-date. |
| 39 |
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) |
| 40 |
) |
| 41 |
|
| 42 |
// Request object for ByteStream.Read. |
| 43 |
type ReadRequest struct { |
| 44 |
state protoimpl.MessageState |
| 45 |
sizeCache protoimpl.SizeCache |
| 46 |
unknownFields protoimpl.UnknownFields |
| 47 |
|
| 48 |
// The name of the resource to read. |
| 49 |
ResourceName string `protobuf:"bytes,1,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"` |
| 50 |
// The offset for the first byte to return in the read, relative to the start |
| 51 |
// of the resource. |
| 52 |
// |
| 53 |
// A `read_offset` that is negative or greater than the size of the resource |
| 54 |
// will cause an `OUT_OF_RANGE` error. |
| 55 |
ReadOffset int64 `protobuf:"varint,2,opt,name=read_offset,json=readOffset,proto3" json:"read_offset,omitempty"` |
| 56 |
// The maximum number of `data` bytes the server is allowed to return in the |
| 57 |
// sum of all `ReadResponse` messages. A `read_limit` of zero indicates that |
| 58 |
// there is no limit, and a negative `read_limit` will cause an error. |
| 59 |
// |
| 60 |
// If the stream returns fewer bytes than allowed by the `read_limit` and no |
| 61 |
// error occurred, the stream includes all data from the `read_offset` to the |
| 62 |
// end of the resource. |
| 63 |
ReadLimit int64 `protobuf:"varint,3,opt,name=read_limit,json=readLimit,proto3" json:"read_limit,omitempty"` |
| 64 |
} |
| 65 |
|
| 66 |
func (x *ReadRequest) Reset() { |
| 67 |
*x = ReadRequest{} |
| 68 |
if protoimpl.UnsafeEnabled { |
| 69 |
mi := &file_google_bytestream_bytestream_proto_msgTypes[0] |
| 70 |
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| 71 |
ms.StoreMessageInfo(mi) |
| 72 |
} |
| 73 |
} |
| 74 |
|
| 75 |
func (x *ReadRequest) String() string { |
| 76 |
return protoimpl.X.MessageStringOf(x) |
| 77 |
} |
| 78 |
|
| 79 |
func (*ReadRequest) ProtoMessage() {} |
| 80 |
|
| 81 |
func (x *ReadRequest) ProtoReflect() protoreflect.Message { |
| 82 |
mi := &file_google_bytestream_bytestream_proto_msgTypes[0] |
| 83 |
if protoimpl.UnsafeEnabled && x != nil { |
| 84 |
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| 85 |
if ms.LoadMessageInfo() == nil { |
| 86 |
ms.StoreMessageInfo(mi) |
| 87 |
} |
| 88 |
return ms |
| 89 |
} |
| 90 |
return mi.MessageOf(x) |
| 91 |
} |
| 92 |
|
| 93 |
// Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead. |
| 94 |
func (*ReadRequest) Descriptor() ([]byte, []int) { |
| 95 |
return file_google_bytestream_bytestream_proto_rawDescGZIP(), []int{0} |
| 96 |
} |
| 97 |
|
| 98 |
func (x *ReadRequest) GetResourceName() string { |
| 99 |
if x != nil { |
| 100 |
return x.ResourceName |
| 101 |
} |
| 102 |
return "" |
| 103 |
} |
| 104 |
|
| 105 |
func (x *ReadRequest) GetReadOffset() int64 { |
| 106 |
if x != nil { |
| 107 |
return x.ReadOffset |
| 108 |
} |
| 109 |
return 0 |
| 110 |
} |
| 111 |
|
| 112 |
func (x *ReadRequest) GetReadLimit() int64 { |
| 113 |
if x != nil { |
| 114 |
return x.ReadLimit |
| 115 |
} |
| 116 |
return 0 |
| 117 |
} |
| 118 |
|
| 119 |
// Response object for ByteStream.Read. |
| 120 |
type ReadResponse struct { |
| 121 |
state protoimpl.MessageState |
| 122 |
sizeCache protoimpl.SizeCache |
| 123 |
unknownFields protoimpl.UnknownFields |
| 124 |
|
| 125 |
// A portion of the data for the resource. The service **may** leave `data` |
| 126 |
// empty for any given `ReadResponse`. This enables the service to inform the |
| 127 |
// client that the request is still live while it is running an operation to |
| 128 |
// generate more data. |
| 129 |
Data []byte `protobuf:"bytes,10,opt,name=data,proto3" json:"data,omitempty"` |
| 130 |
} |
| 131 |
|
| 132 |
func (x *ReadResponse) Reset() { |
| 133 |
*x = ReadResponse{} |
| 134 |
if protoimpl.UnsafeEnabled { |
| 135 |
mi := &file_google_bytestream_bytestream_proto_msgTypes[1] |
| 136 |
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| 137 |
ms.StoreMessageInfo(mi) |
| 138 |
} |
| 139 |
} |
| 140 |
|
| 141 |
func (x *ReadResponse) String() string { |
| 142 |
return protoimpl.X.MessageStringOf(x) |
| 143 |
} |
| 144 |
|
| 145 |
func (*ReadResponse) ProtoMessage() {} |
| 146 |
|
| 147 |
func (x *ReadResponse) ProtoReflect() protoreflect.Message { |
| 148 |
mi := &file_google_bytestream_bytestream_proto_msgTypes[1] |
| 149 |
if protoimpl.UnsafeEnabled && x != nil { |
| 150 |
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| 151 |
if ms.LoadMessageInfo() == nil { |
| 152 |
ms.StoreMessageInfo(mi) |
| 153 |
} |
| 154 |
return ms |
| 155 |
} |
| 156 |
return mi.MessageOf(x) |
| 157 |
} |
| 158 |
|
| 159 |
// Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead. |
| 160 |
func (*ReadResponse) Descriptor() ([]byte, []int) { |
| 161 |
return file_google_bytestream_bytestream_proto_rawDescGZIP(), []int{1} |
| 162 |
} |
| 163 |
|
| 164 |
func (x *ReadResponse) GetData() []byte { |
| 165 |
if x != nil { |
| 166 |
return x.Data |
| 167 |
} |
| 168 |
return nil |
| 169 |
} |
| 170 |
|
| 171 |
// Request object for ByteStream.Write. |
| 172 |
type WriteRequest struct { |
| 173 |
state protoimpl.MessageState |
| 174 |
sizeCache protoimpl.SizeCache |
| 175 |
unknownFields protoimpl.UnknownFields |
| 176 |
|
| 177 |
// The name of the resource to write. This **must** be set on the first |
| 178 |
// `WriteRequest` of each `Write()` action. If it is set on subsequent calls, |
| 179 |
// it **must** match the value of the first request. |
| 180 |
ResourceName string `protobuf:"bytes,1,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"` |
| 181 |
// The offset from the beginning of the resource at which the data should be |
| 182 |
// written. It is required on all `WriteRequest`s. |
| 183 |
// |
| 184 |
// In the first `WriteRequest` of a `Write()` action, it indicates |
| 185 |
// the initial offset for the `Write()` call. The value **must** be equal to |
| 186 |
// the `committed_size` that a call to `QueryWriteStatus()` would return. |
| 187 |
// |
| 188 |
// On subsequent calls, this value **must** be set and **must** be equal to |
| 189 |
// the sum of the first `write_offset` and the sizes of all `data` bundles |
| 190 |
// sent previously on this stream. |
| 191 |
// |
| 192 |
// An incorrect value will cause an error. |
| 193 |
WriteOffset int64 `protobuf:"varint,2,opt,name=write_offset,json=writeOffset,proto3" json:"write_offset,omitempty"` |
| 194 |
// If `true`, this indicates that the write is complete. Sending any |
| 195 |
// `WriteRequest`s subsequent to one in which `finish_write` is `true` will |
| 196 |
// cause an error. |
| 197 |
FinishWrite bool `protobuf:"varint,3,opt,name=finish_write,json=finishWrite,proto3" json:"finish_write,omitempty"` |
| 198 |
// A portion of the data for the resource. The client **may** leave `data` |
| 199 |
// empty for any given `WriteRequest`. This enables the client to inform the |
| 200 |
// service that the request is still live while it is running an operation to |
| 201 |
// generate more data. |
| 202 |
Data []byte `protobuf:"bytes,10,opt,name=data,proto3" json:"data,omitempty"` |
| 203 |
} |
| 204 |
|
| 205 |
func (x *WriteRequest) Reset() { |
| 206 |
*x = WriteRequest{} |
| 207 |
if protoimpl.UnsafeEnabled { |
| 208 |
mi := &file_google_bytestream_bytestream_proto_msgTypes[2] |
| 209 |
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| 210 |
ms.StoreMessageInfo(mi) |
| 211 |
} |
| 212 |
} |
| 213 |
|
| 214 |
func (x *WriteRequest) String() string { |
| 215 |
return protoimpl.X.MessageStringOf(x) |
| 216 |
} |
| 217 |
|
| 218 |
func (*WriteRequest) ProtoMessage() {} |
| 219 |
|
| 220 |
func (x *WriteRequest) ProtoReflect() protoreflect.Message { |
| 221 |
mi := &file_google_bytestream_bytestream_proto_msgTypes[2] |
| 222 |
if protoimpl.UnsafeEnabled && x != nil { |
| 223 |
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| 224 |
if ms.LoadMessageInfo() == nil { |
| 225 |
ms.StoreMessageInfo(mi) |
| 226 |
} |
| 227 |
return ms |
| 228 |
} |
| 229 |
return mi.MessageOf(x) |
| 230 |
} |
| 231 |
|
| 232 |
// Deprecated: Use WriteRequest.ProtoReflect.Descriptor instead. |
| 233 |
func (*WriteRequest) Descriptor() ([]byte, []int) { |
| 234 |
return file_google_bytestream_bytestream_proto_rawDescGZIP(), []int{2} |
| 235 |
} |
| 236 |
|
| 237 |
func (x *WriteRequest) GetResourceName() string { |
| 238 |
if x != nil { |
| 239 |
return x.ResourceName |
| 240 |
} |
| 241 |
return "" |
| 242 |
} |
| 243 |
|
| 244 |
func (x *WriteRequest) GetWriteOffset() int64 { |
| 245 |
if x != nil { |
| 246 |
return x.WriteOffset |
| 247 |
} |
| 248 |
return 0 |
| 249 |
} |
| 250 |
|
| 251 |
func (x *WriteRequest) GetFinishWrite() bool { |
| 252 |
if x != nil { |
| 253 |
return x.FinishWrite |
| 254 |
} |
| 255 |
return false |
| 256 |
} |
| 257 |
|
| 258 |
func (x *WriteRequest) GetData() []byte { |
| 259 |
if x != nil { |
| 260 |
return x.Data |
| 261 |
} |
| 262 |
return nil |
| 263 |
} |
| 264 |
|
| 265 |
// Response object for ByteStream.Write. |
| 266 |
type WriteResponse struct { |
| 267 |
state protoimpl.MessageState |
| 268 |
sizeCache protoimpl.SizeCache |
| 269 |
unknownFields protoimpl.UnknownFields |
| 270 |
|
| 271 |
// The number of bytes that have been processed for the given resource. |
| 272 |
CommittedSize int64 `protobuf:"varint,1,opt,name=committed_size,json=committedSize,proto3" json:"committed_size,omitempty"` |
| 273 |
} |
| 274 |
|
| 275 |
func (x *WriteResponse) Reset() { |
| 276 |
*x = WriteResponse{} |
| 277 |
if protoimpl.UnsafeEnabled { |
| 278 |
mi := &file_google_bytestream_bytestream_proto_msgTypes[3] |
| 279 |
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| 280 |
ms.StoreMessageInfo(mi) |
| 281 |
} |
| 282 |
} |
| 283 |
|
| 284 |
func (x *WriteResponse) String() string { |
| 285 |
return protoimpl.X.MessageStringOf(x) |
| 286 |
} |
| 287 |
|
| 288 |
func (*WriteResponse) ProtoMessage() {} |
| 289 |
|
| 290 |
func (x *WriteResponse) ProtoReflect() protoreflect.Message { |
| 291 |
mi := &file_google_bytestream_bytestream_proto_msgTypes[3] |
| 292 |
if protoimpl.UnsafeEnabled && x != nil { |
| 293 |
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| 294 |
if ms.LoadMessageInfo() == nil { |
| 295 |
ms.StoreMessageInfo(mi) |
| 296 |
} |
| 297 |
return ms |
| 298 |
} |
| 299 |
return mi.MessageOf(x) |
| 300 |
} |
| 301 |
|
| 302 |
// Deprecated: Use WriteResponse.ProtoReflect.Descriptor instead. |
| 303 |
func (*WriteResponse) Descriptor() ([]byte, []int) { |
| 304 |
return file_google_bytestream_bytestream_proto_rawDescGZIP(), []int{3} |
| 305 |
} |
| 306 |
|
| 307 |
func (x *WriteResponse) GetCommittedSize() int64 { |
| 308 |
if x != nil { |
| 309 |
return x.CommittedSize |
| 310 |
} |
| 311 |
return 0 |
| 312 |
} |
| 313 |
|
| 314 |
// Request object for ByteStream.QueryWriteStatus. |
| 315 |
type QueryWriteStatusRequest struct { |
| 316 |
state protoimpl.MessageState |
| 317 |
sizeCache protoimpl.SizeCache |
| 318 |
unknownFields protoimpl.UnknownFields |
| 319 |
|
| 320 |
// The name of the resource whose write status is being requested. |
| 321 |
ResourceName string `protobuf:"bytes,1,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"` |
| 322 |
} |
| 323 |
|
| 324 |
func (x *QueryWriteStatusRequest) Reset() { |
| 325 |
*x = QueryWriteStatusRequest{} |
| 326 |
if protoimpl.UnsafeEnabled { |
| 327 |
mi := &file_google_bytestream_bytestream_proto_msgTypes[4] |
| 328 |
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| 329 |
ms.StoreMessageInfo(mi) |
| 330 |
} |
| 331 |
} |
| 332 |
|
| 333 |
func (x *QueryWriteStatusRequest) String() string { |
| 334 |
return protoimpl.X.MessageStringOf(x) |
| 335 |
} |
| 336 |
|
| 337 |
func (*QueryWriteStatusRequest) ProtoMessage() {} |
| 338 |
|
| 339 |
func (x *QueryWriteStatusRequest) ProtoReflect() protoreflect.Message { |
| 340 |
mi := &file_google_bytestream_bytestream_proto_msgTypes[4] |
| 341 |
if protoimpl.UnsafeEnabled && x != nil { |
| 342 |
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| 343 |
if ms.LoadMessageInfo() == nil { |
| 344 |
ms.StoreMessageInfo(mi) |
| 345 |
} |
| 346 |
return ms |
| 347 |
} |
| 348 |
return mi.MessageOf(x) |
| 349 |
} |
| 350 |
|
| 351 |
// Deprecated: Use QueryWriteStatusRequest.ProtoReflect.Descriptor instead. |
| 352 |
func (*QueryWriteStatusRequest) Descriptor() ([]byte, []int) { |
| 353 |
return file_google_bytestream_bytestream_proto_rawDescGZIP(), []int{4} |
| 354 |
} |
| 355 |
|
| 356 |
func (x *QueryWriteStatusRequest) GetResourceName() string { |
| 357 |
if x != nil { |
| 358 |
return x.ResourceName |
| 359 |
} |
| 360 |
return "" |
| 361 |
} |
| 362 |
|
| 363 |
// Response object for ByteStream.QueryWriteStatus. |
| 364 |
type QueryWriteStatusResponse struct { |
| 365 |
state protoimpl.MessageState |
| 366 |
sizeCache protoimpl.SizeCache |
| 367 |
unknownFields protoimpl.UnknownFields |
| 368 |
|
| 369 |
// The number of bytes that have been processed for the given resource. |
| 370 |
CommittedSize int64 `protobuf:"varint,1,opt,name=committed_size,json=committedSize,proto3" json:"committed_size,omitempty"` |
| 371 |
// `complete` is `true` only if the client has sent a `WriteRequest` with |
| 372 |
// `finish_write` set to true, and the server has processed that request. |
| 373 |
Complete bool `protobuf:"varint,2,opt,name=complete,proto3" json:"complete,omitempty"` |
| 374 |
} |
| 375 |
|
| 376 |
func (x *QueryWriteStatusResponse) Reset() { |
| 377 |
*x = QueryWriteStatusResponse{} |
| 378 |
if protoimpl.UnsafeEnabled { |
| 379 |
mi := &file_google_bytestream_bytestream_proto_msgTypes[5] |
| 380 |
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| 381 |
ms.StoreMessageInfo(mi) |
| 382 |
} |
| 383 |
} |
| 384 |
|
| 385 |
func (x *QueryWriteStatusResponse) String() string { |
| 386 |
return protoimpl.X.MessageStringOf(x) |
| 387 |
} |
| 388 |
|
| 389 |
func (*QueryWriteStatusResponse) ProtoMessage() {} |
| 390 |
|
| 391 |
func (x *QueryWriteStatusResponse) ProtoReflect() protoreflect.Message { |
| 392 |
mi := &file_google_bytestream_bytestream_proto_msgTypes[5] |
| 393 |
if protoimpl.UnsafeEnabled && x != nil { |
| 394 |
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| 395 |
if ms.LoadMessageInfo() == nil { |
| 396 |
ms.StoreMessageInfo(mi) |
| 397 |
} |
| 398 |
return ms |
| 399 |
} |
| 400 |
return mi.MessageOf(x) |
| 401 |
} |
| 402 |
|
| 403 |
// Deprecated: Use QueryWriteStatusResponse.ProtoReflect.Descriptor instead. |
| 404 |
func (*QueryWriteStatusResponse) Descriptor() ([]byte, []int) { |
| 405 |
return file_google_bytestream_bytestream_proto_rawDescGZIP(), []int{5} |
| 406 |
} |
| 407 |
|
| 408 |
func (x *QueryWriteStatusResponse) GetCommittedSize() int64 { |
| 409 |
if x != nil { |
| 410 |
return x.CommittedSize |
| 411 |
} |
| 412 |
return 0 |
| 413 |
} |
| 414 |
|
| 415 |
func (x *QueryWriteStatusResponse) GetComplete() bool { |
| 416 |
if x != nil { |
| 417 |
return x.Complete |
| 418 |
} |
| 419 |
return false |
| 420 |
} |
| 421 |
|
| 422 |
var File_google_bytestream_bytestream_proto protoreflect.FileDescriptor |
| 423 |
|
| 424 |
var file_google_bytestream_bytestream_proto_rawDesc = []byte{ |
| 425 |
0x0a, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x74, 0x72, |
| 426 |
0x65, 0x61, 0x6d, 0x2f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x70, |
| 427 |
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x62, 0x79, 0x74, |
| 428 |
0x65, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x22, 0x72, 0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x52, |
| 429 |
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, |
| 430 |
0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, |
| 431 |
0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, |
| 432 |
0x65, 0x61, 0x64, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, |
| 433 |
0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1d, 0x0a, 0x0a, |
| 434 |
0x72, 0x65, 0x61, 0x64, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, |
| 435 |
0x52, 0x09, 0x72, 0x65, 0x61, 0x64, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x22, 0x0a, 0x0c, 0x52, |
| 436 |
0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, |
| 437 |
0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, |
| 438 |
0x8d, 0x01, 0x0a, 0x0c, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, |
| 439 |
0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, |
| 440 |
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, |
| 441 |
0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, |
| 442 |
0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x77, 0x72, 0x69, |
| 443 |
0x74, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x6e, 0x69, |
| 444 |
0x73, 0x68, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, |
| 445 |
0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, |
| 446 |
0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, |
| 447 |
0x36, 0x0a, 0x0d, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, |
| 448 |
0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, |
| 449 |
0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, |
| 450 |
0x74, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x3e, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, |
| 451 |
0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, |
| 452 |
0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, |
| 453 |
0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, |
| 454 |
0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x5d, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, |
| 455 |
0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, |
| 456 |
0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, |
| 457 |
0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x6f, 0x6d, |
| 458 |
0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, |
| 459 |
0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x6f, |
| 460 |
0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x32, 0x92, 0x02, 0x0a, 0x0a, 0x42, 0x79, 0x74, 0x65, 0x53, |
| 461 |
0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x49, 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, 0x1e, 0x2e, |
| 462 |
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, 0x61, |
| 463 |
0x6d, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, |
| 464 |
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, 0x61, |
| 465 |
0x6d, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, |
| 466 |
0x12, 0x4c, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, |
| 467 |
0x6c, 0x65, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x57, 0x72, |
| 468 |
0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x67, 0x6f, 0x6f, |
| 469 |
0x67, 0x6c, 0x65, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x57, |
| 470 |
0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, 0x6b, |
| 471 |
0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, |
| 472 |
0x75, 0x73, 0x12, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x62, 0x79, 0x74, 0x65, |
| 473 |
0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x72, 0x69, 0x74, |
| 474 |
0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, |
| 475 |
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, |
| 476 |
0x61, 0x6d, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, |
| 477 |
0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x65, 0x0a, 0x15, 0x63, |
| 478 |
0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x73, 0x74, |
| 479 |
0x72, 0x65, 0x61, 0x6d, 0x42, 0x0f, 0x42, 0x79, 0x74, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, |
| 480 |
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x5a, 0x3b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, |
| 481 |
0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, |
| 482 |
0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x62, 0x79, 0x74, |
| 483 |
0x65, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x3b, 0x62, 0x79, 0x74, 0x65, 0x73, 0x74, 0x72, 0x65, |
| 484 |
0x61, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, |
| 485 |
} |
| 486 |
|
| 487 |
var ( |
| 488 |
file_google_bytestream_bytestream_proto_rawDescOnce sync.Once |
| 489 |
file_google_bytestream_bytestream_proto_rawDescData = file_google_bytestream_bytestream_proto_rawDesc |
| 490 |
) |
| 491 |
|
| 492 |
func file_google_bytestream_bytestream_proto_rawDescGZIP() []byte { |
| 493 |
file_google_bytestream_bytestream_proto_rawDescOnce.Do(func() { |
| 494 |
file_google_bytestream_bytestream_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_bytestream_bytestream_proto_rawDescData) |
| 495 |
}) |
| 496 |
return file_google_bytestream_bytestream_proto_rawDescData |
| 497 |
} |
| 498 |
|
| 499 |
var file_google_bytestream_bytestream_proto_msgTypes = make([]protoimpl.MessageInfo, 6) |
| 500 |
var file_google_bytestream_bytestream_proto_goTypes = []interface{}{ |
| 501 |
(*ReadRequest)(nil), // 0: google.bytestream.ReadRequest |
| 502 |
(*ReadResponse)(nil), // 1: google.bytestream.ReadResponse |
| 503 |
(*WriteRequest)(nil), // 2: google.bytestream.WriteRequest |
| 504 |
(*WriteResponse)(nil), // 3: google.bytestream.WriteResponse |
| 505 |
(*QueryWriteStatusRequest)(nil), // 4: google.bytestream.QueryWriteStatusRequest |
| 506 |
(*QueryWriteStatusResponse)(nil), // 5: google.bytestream.QueryWriteStatusResponse |
| 507 |
} |
| 508 |
var file_google_bytestream_bytestream_proto_depIdxs = []int32{ |
| 509 |
0, // 0: google.bytestream.ByteStream.Read:input_type -> google.bytestream.ReadRequest |
| 510 |
2, // 1: google.bytestream.ByteStream.Write:input_type -> google.bytestream.WriteRequest |
| 511 |
4, // 2: google.bytestream.ByteStream.QueryWriteStatus:input_type -> google.bytestream.QueryWriteStatusRequest |
| 512 |
1, // 3: google.bytestream.ByteStream.Read:output_type -> google.bytestream.ReadResponse |
| 513 |
3, // 4: google.bytestream.ByteStream.Write:output_type -> google.bytestream.WriteResponse |
| 514 |
5, // 5: google.bytestream.ByteStream.QueryWriteStatus:output_type -> google.bytestream.QueryWriteStatusResponse |
| 515 |
3, // [3:6] is the sub-list for method output_type |
| 516 |
0, // [0:3] is the sub-list for method input_type |
| 517 |
0, // [0:0] is the sub-list for extension type_name |
| 518 |
0, // [0:0] is the sub-list for extension extendee |
| 519 |
0, // [0:0] is the sub-list for field type_name |
| 520 |
} |
| 521 |
|
| 522 |
func init() { file_google_bytestream_bytestream_proto_init() } |
| 523 |
func file_google_bytestream_bytestream_proto_init() { |
| 524 |
if File_google_bytestream_bytestream_proto != nil { |
| 525 |
return |
| 526 |
} |
| 527 |
if !protoimpl.UnsafeEnabled { |
| 528 |
file_google_bytestream_bytestream_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { |
| 529 |
switch v := v.(*ReadRequest); i { |
| 530 |
case 0: |
| 531 |
return &v.state |
| 532 |
case 1: |
| 533 |
return &v.sizeCache |
| 534 |
case 2: |
| 535 |
return &v.unknownFields |
| 536 |
default: |
| 537 |
return nil |
| 538 |
} |
| 539 |
} |
| 540 |
file_google_bytestream_bytestream_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { |
| 541 |
switch v := v.(*ReadResponse); i { |
| 542 |
case 0: |
| 543 |
return &v.state |
| 544 |
case 1: |
| 545 |
return &v.sizeCache |
| 546 |
case 2: |
| 547 |
return &v.unknownFields |
| 548 |
default: |
| 549 |
return nil |
| 550 |
} |
| 551 |
} |
| 552 |
file_google_bytestream_bytestream_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { |
| 553 |
switch v := v.(*WriteRequest); i { |
| 554 |
case 0: |
| 555 |
return &v.state |
| 556 |
case 1: |
| 557 |
return &v.sizeCache |
| 558 |
case 2: |
| 559 |
return &v.unknownFields |
| 560 |
default: |
| 561 |
return nil |
| 562 |
} |
| 563 |
} |
| 564 |
file_google_bytestream_bytestream_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { |
| 565 |
switch v := v.(*WriteResponse); i { |
| 566 |
case 0: |
| 567 |
return &v.state |
| 568 |
case 1: |
| 569 |
return &v.sizeCache |
| 570 |
case 2: |
| 571 |
return &v.unknownFields |
| 572 |
default: |
| 573 |
return nil |
| 574 |
} |
| 575 |
} |
| 576 |
file_google_bytestream_bytestream_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { |
| 577 |
switch v := v.(*QueryWriteStatusRequest); i { |
| 578 |
case 0: |
| 579 |
return &v.state |
| 580 |
case 1: |
| 581 |
return &v.sizeCache |
| 582 |
case 2: |
| 583 |
return &v.unknownFields |
| 584 |
default: |
| 585 |
return nil |
| 586 |
} |
| 587 |
} |
| 588 |
file_google_bytestream_bytestream_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { |
| 589 |
switch v := v.(*QueryWriteStatusResponse); i { |
| 590 |
case 0: |
| 591 |
return &v.state |
| 592 |
case 1: |
| 593 |
return &v.sizeCache |
| 594 |
case 2: |
| 595 |
return &v.unknownFields |
| 596 |
default: |
| 597 |
return nil |
| 598 |
} |
| 599 |
} |
| 600 |
} |
| 601 |
type x struct{} |
| 602 |
out := protoimpl.TypeBuilder{ |
| 603 |
File: protoimpl.DescBuilder{ |
| 604 |
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), |
| 605 |
RawDescriptor: file_google_bytestream_bytestream_proto_rawDesc, |
| 606 |
NumEnums: 0, |
| 607 |
NumMessages: 6, |
| 608 |
NumExtensions: 0, |
| 609 |
NumServices: 1, |
| 610 |
}, |
| 611 |
GoTypes: file_google_bytestream_bytestream_proto_goTypes, |
| 612 |
DependencyIndexes: file_google_bytestream_bytestream_proto_depIdxs, |
| 613 |
MessageInfos: file_google_bytestream_bytestream_proto_msgTypes, |
| 614 |
}.Build() |
| 615 |
File_google_bytestream_bytestream_proto = out.File |
| 616 |
file_google_bytestream_bytestream_proto_rawDesc = nil |
| 617 |
file_google_bytestream_bytestream_proto_goTypes = nil |
| 618 |
file_google_bytestream_bytestream_proto_depIdxs = nil |
| 619 |
} |
| 620 |
|
| 621 |
// Reference imports to suppress errors if they are not otherwise used. |
| 622 |
var _ context.Context |
| 623 |
var _ grpc.ClientConnInterface |
| 624 |
|
| 625 |
// This is a compile-time assertion to ensure that this generated file |
| 626 |
// is compatible with the grpc package it is being compiled against. |
| 627 |
const _ = grpc.SupportPackageIsVersion6 |
| 628 |
|
| 629 |
// ByteStreamClient is the client API for ByteStream service. |
| 630 |
// |
| 631 |
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. |
| 632 |
type ByteStreamClient interface { |
| 633 |
// `Read()` is used to retrieve the contents of a resource as a sequence |
| 634 |
// of bytes. The bytes are returned in a sequence of responses, and the |
| 635 |
// responses are delivered as the results of a server-side streaming RPC. |
| 636 |
Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (ByteStream_ReadClient, error) |
| 637 |
// `Write()` is used to send the contents of a resource as a sequence of |
| 638 |
// bytes. The bytes are sent in a sequence of request protos of a client-side |
| 639 |
// streaming RPC. |
| 640 |
// |
| 641 |
// A `Write()` action is resumable. If there is an error or the connection is |
| 642 |
// broken during the `Write()`, the client should check the status of the |
| 643 |
// `Write()` by calling `QueryWriteStatus()` and continue writing from the |
| 644 |
// returned `committed_size`. This may be less than the amount of data the |
| 645 |
// client previously sent. |
| 646 |
// |
| 647 |
// Calling `Write()` on a resource name that was previously written and |
| 648 |
// finalized could cause an error, depending on whether the underlying service |
| 649 |
// allows over-writing of previously written resources. |
| 650 |
// |
| 651 |
// When the client closes the request channel, the service will respond with |
| 652 |
// a `WriteResponse`. The service will not view the resource as `complete` |
| 653 |
// until the client has sent a `WriteRequest` with `finish_write` set to |
| 654 |
// `true`. Sending any requests on a stream after sending a request with |
| 655 |
// `finish_write` set to `true` will cause an error. The client **should** |
| 656 |
// check the `WriteResponse` it receives to determine how much data the |
| 657 |
// service was able to commit and whether the service views the resource as |
| 658 |
// `complete` or not. |
| 659 |
Write(ctx context.Context, opts ...grpc.CallOption) (ByteStream_WriteClient, error) |
| 660 |
// `QueryWriteStatus()` is used to find the `committed_size` for a resource |
| 661 |
// that is being written, which can then be used as the `write_offset` for |
| 662 |
// the next `Write()` call. |
| 663 |
// |
| 664 |
// If the resource does not exist (i.e., the resource has been deleted, or the |
| 665 |
// first `Write()` has not yet reached the service), this method returns the |
| 666 |
// error `NOT_FOUND`. |
| 667 |
// |
| 668 |
// The client **may** call `QueryWriteStatus()` at any time to determine how |
| 669 |
// much data has been processed for this resource. This is useful if the |
| 670 |
// client is buffering data and needs to know which data can be safely |
| 671 |
// evicted. For any sequence of `QueryWriteStatus()` calls for a given |
| 672 |
// resource name, the sequence of returned `committed_size` values will be |
| 673 |
// non-decreasing. |
| 674 |
QueryWriteStatus(ctx context.Context, in *QueryWriteStatusRequest, opts ...grpc.CallOption) (*QueryWriteStatusResponse, error) |
| 675 |
} |
| 676 |
|
| 677 |
type byteStreamClient struct { |
| 678 |
cc grpc.ClientConnInterface |
| 679 |
} |
| 680 |
|
| 681 |
func NewByteStreamClient(cc grpc.ClientConnInterface) ByteStreamClient { |
| 682 |
return &byteStreamClient{cc} |
| 683 |
} |
| 684 |
|
| 685 |
func (c *byteStreamClient) Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (ByteStream_ReadClient, error) { |
| 686 |
stream, err := c.cc.NewStream(ctx, &_ByteStream_serviceDesc.Streams[0], "/google.bytestream.ByteStream/Read", opts...) |
| 687 |
if err != nil { |
| 688 |
return nil, err |
| 689 |
} |
| 690 |
x := &byteStreamReadClient{stream} |
| 691 |
if err := x.ClientStream.SendMsg(in); err != nil { |
| 692 |
return nil, err |
| 693 |
} |
| 694 |
if err := x.ClientStream.CloseSend(); err != nil { |
| 695 |
return nil, err |
| 696 |
} |
| 697 |
return x, nil |
| 698 |
} |
| 699 |
|
| 700 |
type ByteStream_ReadClient interface { |
| 701 |
Recv() (*ReadResponse, error) |
| 702 |
grpc.ClientStream |
| 703 |
} |
| 704 |
|
| 705 |
type byteStreamReadClient struct { |
| 706 |
grpc.ClientStream |
| 707 |
} |
| 708 |
|
| 709 |
func (x *byteStreamReadClient) Recv() (*ReadResponse, error) { |
| 710 |
m := new(ReadResponse) |
| 711 |
if err := x.ClientStream.RecvMsg(m); err != nil { |
| 712 |
return nil, err |
| 713 |
} |
| 714 |
return m, nil |
| 715 |
} |
| 716 |
|
| 717 |
func (c *byteStreamClient) Write(ctx context.Context, opts ...grpc.CallOption) (ByteStream_WriteClient, error) { |
| 718 |
stream, err := c.cc.NewStream(ctx, &_ByteStream_serviceDesc.Streams[1], "/google.bytestream.ByteStream/Write", opts...) |
| 719 |
if err != nil { |
| 720 |
return nil, err |
| 721 |
} |
| 722 |
x := &byteStreamWriteClient{stream} |
| 723 |
return x, nil |
| 724 |
} |
| 725 |
|
| 726 |
type ByteStream_WriteClient interface { |
| 727 |
Send(*WriteRequest) error |
| 728 |
CloseAndRecv() (*WriteResponse, error) |
| 729 |
grpc.ClientStream |
| 730 |
} |
| 731 |
|
| 732 |
type byteStreamWriteClient struct { |
| 733 |
grpc.ClientStream |
| 734 |
} |
| 735 |
|
| 736 |
func (x *byteStreamWriteClient) Send(m *WriteRequest) error { |
| 737 |
return x.ClientStream.SendMsg(m) |
| 738 |
} |
| 739 |
|
| 740 |
func (x *byteStreamWriteClient) CloseAndRecv() (*WriteResponse, error) { |
| 741 |
if err := x.ClientStream.CloseSend(); err != nil { |
| 742 |
return nil, err |
| 743 |
} |
| 744 |
m := new(WriteResponse) |
| 745 |
if err := x.ClientStream.RecvMsg(m); err != nil { |
| 746 |
return nil, err |
| 747 |
} |
| 748 |
return m, nil |
| 749 |
} |
| 750 |
|
| 751 |
func (c *byteStreamClient) QueryWriteStatus(ctx context.Context, in *QueryWriteStatusRequest, opts ...grpc.CallOption) (*QueryWriteStatusResponse, error) { |
| 752 |
out := new(QueryWriteStatusResponse) |
| 753 |
err := c.cc.Invoke(ctx, "/google.bytestream.ByteStream/QueryWriteStatus", in, out, opts...) |
| 754 |
if err != nil { |
| 755 |
return nil, err |
| 756 |
} |
| 757 |
return out, nil |
| 758 |
} |
| 759 |
|
| 760 |
// ByteStreamServer is the server API for ByteStream service. |
| 761 |
type ByteStreamServer interface { |
| 762 |
// `Read()` is used to retrieve the contents of a resource as a sequence |
| 763 |
// of bytes. The bytes are returned in a sequence of responses, and the |
| 764 |
// responses are delivered as the results of a server-side streaming RPC. |
| 765 |
Read(*ReadRequest, ByteStream_ReadServer) error |
| 766 |
// `Write()` is used to send the contents of a resource as a sequence of |
| 767 |
// bytes. The bytes are sent in a sequence of request protos of a client-side |
| 768 |
// streaming RPC. |
| 769 |
// |
| 770 |
// A `Write()` action is resumable. If there is an error or the connection is |
| 771 |
// broken during the `Write()`, the client should check the status of the |
| 772 |
// `Write()` by calling `QueryWriteStatus()` and continue writing from the |
| 773 |
// returned `committed_size`. This may be less than the amount of data the |
| 774 |
// client previously sent. |
| 775 |
// |
| 776 |
// Calling `Write()` on a resource name that was previously written and |
| 777 |
// finalized could cause an error, depending on whether the underlying service |
| 778 |
// allows over-writing of previously written resources. |
| 779 |
// |
| 780 |
// When the client closes the request channel, the service will respond with |
| 781 |
// a `WriteResponse`. The service will not view the resource as `complete` |
| 782 |
// until the client has sent a `WriteRequest` with `finish_write` set to |
| 783 |
// `true`. Sending any requests on a stream after sending a request with |
| 784 |
// `finish_write` set to `true` will cause an error. The client **should** |
| 785 |
// check the `WriteResponse` it receives to determine how much data the |
| 786 |
// service was able to commit and whether the service views the resource as |
| 787 |
// `complete` or not. |
| 788 |
Write(ByteStream_WriteServer) error |
| 789 |
// `QueryWriteStatus()` is used to find the `committed_size` for a resource |
| 790 |
// that is being written, which can then be used as the `write_offset` for |
| 791 |
// the next `Write()` call. |
| 792 |
// |
| 793 |
// If the resource does not exist (i.e., the resource has been deleted, or the |
| 794 |
// first `Write()` has not yet reached the service), this method returns the |
| 795 |
// error `NOT_FOUND`. |
| 796 |
// |
| 797 |
// The client **may** call `QueryWriteStatus()` at any time to determine how |
| 798 |
// much data has been processed for this resource. This is useful if the |
| 799 |
// client is buffering data and needs to know which data can be safely |
| 800 |
// evicted. For any sequence of `QueryWriteStatus()` calls for a given |
| 801 |
// resource name, the sequence of returned `committed_size` values will be |
| 802 |
// non-decreasing. |
| 803 |
QueryWriteStatus(context.Context, *QueryWriteStatusRequest) (*QueryWriteStatusResponse, error) |
| 804 |
} |
| 805 |
|
| 806 |
// UnimplementedByteStreamServer can be embedded to have forward compatible implementations. |
| 807 |
type UnimplementedByteStreamServer struct { |
| 808 |
} |
| 809 |
|
| 810 |
func (*UnimplementedByteStreamServer) Read(*ReadRequest, ByteStream_ReadServer) error { |
| 811 |
return status.Errorf(codes.Unimplemented, "method Read not implemented") |
| 812 |
} |
| 813 |
func (*UnimplementedByteStreamServer) Write(ByteStream_WriteServer) error { |
| 814 |
return status.Errorf(codes.Unimplemented, "method Write not implemented") |
| 815 |
} |
| 816 |
func (*UnimplementedByteStreamServer) QueryWriteStatus(context.Context, *QueryWriteStatusRequest) (*QueryWriteStatusResponse, error) { |
| 817 |
return nil, status.Errorf(codes.Unimplemented, "method QueryWriteStatus not implemented") |
| 818 |
} |
| 819 |
|
| 820 |
func RegisterByteStreamServer(s *grpc.Server, srv ByteStreamServer) { |
| 821 |
s.RegisterService(&_ByteStream_serviceDesc, srv) |
| 822 |
} |
| 823 |
|
| 824 |
func _ByteStream_Read_Handler(srv interface{}, stream grpc.ServerStream) error { |
| 825 |
m := new(ReadRequest) |
| 826 |
if err := stream.RecvMsg(m); err != nil { |
| 827 |
return err |
| 828 |
} |
| 829 |
return srv.(ByteStreamServer).Read(m, &byteStreamReadServer{stream}) |
| 830 |
} |
| 831 |
|
| 832 |
type ByteStream_ReadServer interface { |
| 833 |
Send(*ReadResponse) error |
| 834 |
grpc.ServerStream |
| 835 |
} |
| 836 |
|
| 837 |
type byteStreamReadServer struct { |
| 838 |
grpc.ServerStream |
| 839 |
} |
| 840 |
|
| 841 |
func (x *byteStreamReadServer) Send(m *ReadResponse) error { |
| 842 |
return x.ServerStream.SendMsg(m) |
| 843 |
} |
| 844 |
|
| 845 |
func _ByteStream_Write_Handler(srv interface{}, stream grpc.ServerStream) error { |
| 846 |
return srv.(ByteStreamServer).Write(&byteStreamWriteServer{stream}) |
| 847 |
} |
| 848 |
|
| 849 |
type ByteStream_WriteServer interface { |
| 850 |
SendAndClose(*WriteResponse) error |
| 851 |
Recv() (*WriteRequest, error) |
| 852 |
grpc.ServerStream |
| 853 |
} |
| 854 |
|
| 855 |
type byteStreamWriteServer struct { |
| 856 |
grpc.ServerStream |
| 857 |
} |
| 858 |
|
| 859 |
func (x *byteStreamWriteServer) SendAndClose(m *WriteResponse) error { |
| 860 |
return x.ServerStream.SendMsg(m) |
| 861 |
} |
| 862 |
|
| 863 |
func (x *byteStreamWriteServer) Recv() (*WriteRequest, error) { |
| 864 |
m := new(WriteRequest) |
| 865 |
if err := x.ServerStream.RecvMsg(m); err != nil { |
| 866 |
return nil, err |
| 867 |
} |
| 868 |
return m, nil |
| 869 |
} |
| 870 |
|
| 871 |
func _ByteStream_QueryWriteStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 872 |
in := new(QueryWriteStatusRequest) |
| 873 |
if err := dec(in); err != nil { |
| 874 |
return nil, err |
| 875 |
} |
| 876 |
if interceptor == nil { |
| 877 |
return srv.(ByteStreamServer).QueryWriteStatus(ctx, in) |
| 878 |
} |
| 879 |
info := &grpc.UnaryServerInfo{ |
| 880 |
Server: srv, |
| 881 |
FullMethod: "/google.bytestream.ByteStream/QueryWriteStatus", |
| 882 |
} |
| 883 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 884 |
return srv.(ByteStreamServer).QueryWriteStatus(ctx, req.(*QueryWriteStatusRequest)) |
| 885 |
} |
| 886 |
return interceptor(ctx, in, info, handler) |
| 887 |
} |
| 888 |
|
| 889 |
var _ByteStream_serviceDesc = grpc.ServiceDesc{ |
| 890 |
ServiceName: "google.bytestream.ByteStream", |
| 891 |
HandlerType: (*ByteStreamServer)(nil), |
| 892 |
Methods: []grpc.MethodDesc{ |
| 893 |
{ |
| 894 |
MethodName: "QueryWriteStatus", |
| 895 |
Handler: _ByteStream_QueryWriteStatus_Handler, |
| 896 |
}, |
| 897 |
}, |
| 898 |
Streams: []grpc.StreamDesc{ |
| 899 |
{ |
| 900 |
StreamName: "Read", |
| 901 |
Handler: _ByteStream_Read_Handler, |
| 902 |
ServerStreams: true, |
| 903 |
}, |
| 904 |
{ |
| 905 |
StreamName: "Write", |
| 906 |
Handler: _ByteStream_Write_Handler, |
| 907 |
ClientStreams: true, |
| 908 |
}, |
| 909 |
}, |
| 910 |
Metadata: "google/bytestream/bytestream.proto", |
| 911 |
} |