Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 

676 рядки
26 KiB

  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: google/bytestream/bytestream.proto
  3. package bytestream // import "google.golang.org/genproto/googleapis/bytestream"
  4. import proto "github.com/golang/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. import _ "github.com/golang/protobuf/ptypes/wrappers"
  8. import _ "google.golang.org/genproto/googleapis/api/annotations"
  9. import (
  10. context "golang.org/x/net/context"
  11. grpc "google.golang.org/grpc"
  12. )
  13. // Reference imports to suppress errors if they are not otherwise used.
  14. var _ = proto.Marshal
  15. var _ = fmt.Errorf
  16. var _ = math.Inf
  17. // This is a compile-time assertion to ensure that this generated file
  18. // is compatible with the proto package it is being compiled against.
  19. // A compilation error at this line likely means your copy of the
  20. // proto package needs to be updated.
  21. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  22. // Request object for ByteStream.Read.
  23. type ReadRequest struct {
  24. // The name of the resource to read.
  25. ResourceName string `protobuf:"bytes,1,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"`
  26. // The offset for the first byte to return in the read, relative to the start
  27. // of the resource.
  28. //
  29. // A `read_offset` that is negative or greater than the size of the resource
  30. // will cause an `OUT_OF_RANGE` error.
  31. ReadOffset int64 `protobuf:"varint,2,opt,name=read_offset,json=readOffset,proto3" json:"read_offset,omitempty"`
  32. // The maximum number of `data` bytes the server is allowed to return in the
  33. // sum of all `ReadResponse` messages. A `read_limit` of zero indicates that
  34. // there is no limit, and a negative `read_limit` will cause an error.
  35. //
  36. // If the stream returns fewer bytes than allowed by the `read_limit` and no
  37. // error occurred, the stream includes all data from the `read_offset` to the
  38. // end of the resource.
  39. ReadLimit int64 `protobuf:"varint,3,opt,name=read_limit,json=readLimit,proto3" json:"read_limit,omitempty"`
  40. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  41. XXX_unrecognized []byte `json:"-"`
  42. XXX_sizecache int32 `json:"-"`
  43. }
  44. func (m *ReadRequest) Reset() { *m = ReadRequest{} }
  45. func (m *ReadRequest) String() string { return proto.CompactTextString(m) }
  46. func (*ReadRequest) ProtoMessage() {}
  47. func (*ReadRequest) Descriptor() ([]byte, []int) {
  48. return fileDescriptor_bytestream_e682df2b5477b695, []int{0}
  49. }
  50. func (m *ReadRequest) XXX_Unmarshal(b []byte) error {
  51. return xxx_messageInfo_ReadRequest.Unmarshal(m, b)
  52. }
  53. func (m *ReadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  54. return xxx_messageInfo_ReadRequest.Marshal(b, m, deterministic)
  55. }
  56. func (dst *ReadRequest) XXX_Merge(src proto.Message) {
  57. xxx_messageInfo_ReadRequest.Merge(dst, src)
  58. }
  59. func (m *ReadRequest) XXX_Size() int {
  60. return xxx_messageInfo_ReadRequest.Size(m)
  61. }
  62. func (m *ReadRequest) XXX_DiscardUnknown() {
  63. xxx_messageInfo_ReadRequest.DiscardUnknown(m)
  64. }
  65. var xxx_messageInfo_ReadRequest proto.InternalMessageInfo
  66. func (m *ReadRequest) GetResourceName() string {
  67. if m != nil {
  68. return m.ResourceName
  69. }
  70. return ""
  71. }
  72. func (m *ReadRequest) GetReadOffset() int64 {
  73. if m != nil {
  74. return m.ReadOffset
  75. }
  76. return 0
  77. }
  78. func (m *ReadRequest) GetReadLimit() int64 {
  79. if m != nil {
  80. return m.ReadLimit
  81. }
  82. return 0
  83. }
  84. // Response object for ByteStream.Read.
  85. type ReadResponse struct {
  86. // A portion of the data for the resource. The service **may** leave `data`
  87. // empty for any given `ReadResponse`. This enables the service to inform the
  88. // client that the request is still live while it is running an operation to
  89. // generate more data.
  90. Data []byte `protobuf:"bytes,10,opt,name=data,proto3" json:"data,omitempty"`
  91. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  92. XXX_unrecognized []byte `json:"-"`
  93. XXX_sizecache int32 `json:"-"`
  94. }
  95. func (m *ReadResponse) Reset() { *m = ReadResponse{} }
  96. func (m *ReadResponse) String() string { return proto.CompactTextString(m) }
  97. func (*ReadResponse) ProtoMessage() {}
  98. func (*ReadResponse) Descriptor() ([]byte, []int) {
  99. return fileDescriptor_bytestream_e682df2b5477b695, []int{1}
  100. }
  101. func (m *ReadResponse) XXX_Unmarshal(b []byte) error {
  102. return xxx_messageInfo_ReadResponse.Unmarshal(m, b)
  103. }
  104. func (m *ReadResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  105. return xxx_messageInfo_ReadResponse.Marshal(b, m, deterministic)
  106. }
  107. func (dst *ReadResponse) XXX_Merge(src proto.Message) {
  108. xxx_messageInfo_ReadResponse.Merge(dst, src)
  109. }
  110. func (m *ReadResponse) XXX_Size() int {
  111. return xxx_messageInfo_ReadResponse.Size(m)
  112. }
  113. func (m *ReadResponse) XXX_DiscardUnknown() {
  114. xxx_messageInfo_ReadResponse.DiscardUnknown(m)
  115. }
  116. var xxx_messageInfo_ReadResponse proto.InternalMessageInfo
  117. func (m *ReadResponse) GetData() []byte {
  118. if m != nil {
  119. return m.Data
  120. }
  121. return nil
  122. }
  123. // Request object for ByteStream.Write.
  124. type WriteRequest struct {
  125. // The name of the resource to write. This **must** be set on the first
  126. // `WriteRequest` of each `Write()` action. If it is set on subsequent calls,
  127. // it **must** match the value of the first request.
  128. ResourceName string `protobuf:"bytes,1,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"`
  129. // The offset from the beginning of the resource at which the data should be
  130. // written. It is required on all `WriteRequest`s.
  131. //
  132. // In the first `WriteRequest` of a `Write()` action, it indicates
  133. // the initial offset for the `Write()` call. The value **must** be equal to
  134. // the `committed_size` that a call to `QueryWriteStatus()` would return.
  135. //
  136. // On subsequent calls, this value **must** be set and **must** be equal to
  137. // the sum of the first `write_offset` and the sizes of all `data` bundles
  138. // sent previously on this stream.
  139. //
  140. // An incorrect value will cause an error.
  141. WriteOffset int64 `protobuf:"varint,2,opt,name=write_offset,json=writeOffset,proto3" json:"write_offset,omitempty"`
  142. // If `true`, this indicates that the write is complete. Sending any
  143. // `WriteRequest`s subsequent to one in which `finish_write` is `true` will
  144. // cause an error.
  145. FinishWrite bool `protobuf:"varint,3,opt,name=finish_write,json=finishWrite,proto3" json:"finish_write,omitempty"`
  146. // A portion of the data for the resource. The client **may** leave `data`
  147. // empty for any given `WriteRequest`. This enables the client to inform the
  148. // service that the request is still live while it is running an operation to
  149. // generate more data.
  150. Data []byte `protobuf:"bytes,10,opt,name=data,proto3" json:"data,omitempty"`
  151. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  152. XXX_unrecognized []byte `json:"-"`
  153. XXX_sizecache int32 `json:"-"`
  154. }
  155. func (m *WriteRequest) Reset() { *m = WriteRequest{} }
  156. func (m *WriteRequest) String() string { return proto.CompactTextString(m) }
  157. func (*WriteRequest) ProtoMessage() {}
  158. func (*WriteRequest) Descriptor() ([]byte, []int) {
  159. return fileDescriptor_bytestream_e682df2b5477b695, []int{2}
  160. }
  161. func (m *WriteRequest) XXX_Unmarshal(b []byte) error {
  162. return xxx_messageInfo_WriteRequest.Unmarshal(m, b)
  163. }
  164. func (m *WriteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  165. return xxx_messageInfo_WriteRequest.Marshal(b, m, deterministic)
  166. }
  167. func (dst *WriteRequest) XXX_Merge(src proto.Message) {
  168. xxx_messageInfo_WriteRequest.Merge(dst, src)
  169. }
  170. func (m *WriteRequest) XXX_Size() int {
  171. return xxx_messageInfo_WriteRequest.Size(m)
  172. }
  173. func (m *WriteRequest) XXX_DiscardUnknown() {
  174. xxx_messageInfo_WriteRequest.DiscardUnknown(m)
  175. }
  176. var xxx_messageInfo_WriteRequest proto.InternalMessageInfo
  177. func (m *WriteRequest) GetResourceName() string {
  178. if m != nil {
  179. return m.ResourceName
  180. }
  181. return ""
  182. }
  183. func (m *WriteRequest) GetWriteOffset() int64 {
  184. if m != nil {
  185. return m.WriteOffset
  186. }
  187. return 0
  188. }
  189. func (m *WriteRequest) GetFinishWrite() bool {
  190. if m != nil {
  191. return m.FinishWrite
  192. }
  193. return false
  194. }
  195. func (m *WriteRequest) GetData() []byte {
  196. if m != nil {
  197. return m.Data
  198. }
  199. return nil
  200. }
  201. // Response object for ByteStream.Write.
  202. type WriteResponse struct {
  203. // The number of bytes that have been processed for the given resource.
  204. CommittedSize int64 `protobuf:"varint,1,opt,name=committed_size,json=committedSize,proto3" json:"committed_size,omitempty"`
  205. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  206. XXX_unrecognized []byte `json:"-"`
  207. XXX_sizecache int32 `json:"-"`
  208. }
  209. func (m *WriteResponse) Reset() { *m = WriteResponse{} }
  210. func (m *WriteResponse) String() string { return proto.CompactTextString(m) }
  211. func (*WriteResponse) ProtoMessage() {}
  212. func (*WriteResponse) Descriptor() ([]byte, []int) {
  213. return fileDescriptor_bytestream_e682df2b5477b695, []int{3}
  214. }
  215. func (m *WriteResponse) XXX_Unmarshal(b []byte) error {
  216. return xxx_messageInfo_WriteResponse.Unmarshal(m, b)
  217. }
  218. func (m *WriteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  219. return xxx_messageInfo_WriteResponse.Marshal(b, m, deterministic)
  220. }
  221. func (dst *WriteResponse) XXX_Merge(src proto.Message) {
  222. xxx_messageInfo_WriteResponse.Merge(dst, src)
  223. }
  224. func (m *WriteResponse) XXX_Size() int {
  225. return xxx_messageInfo_WriteResponse.Size(m)
  226. }
  227. func (m *WriteResponse) XXX_DiscardUnknown() {
  228. xxx_messageInfo_WriteResponse.DiscardUnknown(m)
  229. }
  230. var xxx_messageInfo_WriteResponse proto.InternalMessageInfo
  231. func (m *WriteResponse) GetCommittedSize() int64 {
  232. if m != nil {
  233. return m.CommittedSize
  234. }
  235. return 0
  236. }
  237. // Request object for ByteStream.QueryWriteStatus.
  238. type QueryWriteStatusRequest struct {
  239. // The name of the resource whose write status is being requested.
  240. ResourceName string `protobuf:"bytes,1,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"`
  241. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  242. XXX_unrecognized []byte `json:"-"`
  243. XXX_sizecache int32 `json:"-"`
  244. }
  245. func (m *QueryWriteStatusRequest) Reset() { *m = QueryWriteStatusRequest{} }
  246. func (m *QueryWriteStatusRequest) String() string { return proto.CompactTextString(m) }
  247. func (*QueryWriteStatusRequest) ProtoMessage() {}
  248. func (*QueryWriteStatusRequest) Descriptor() ([]byte, []int) {
  249. return fileDescriptor_bytestream_e682df2b5477b695, []int{4}
  250. }
  251. func (m *QueryWriteStatusRequest) XXX_Unmarshal(b []byte) error {
  252. return xxx_messageInfo_QueryWriteStatusRequest.Unmarshal(m, b)
  253. }
  254. func (m *QueryWriteStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  255. return xxx_messageInfo_QueryWriteStatusRequest.Marshal(b, m, deterministic)
  256. }
  257. func (dst *QueryWriteStatusRequest) XXX_Merge(src proto.Message) {
  258. xxx_messageInfo_QueryWriteStatusRequest.Merge(dst, src)
  259. }
  260. func (m *QueryWriteStatusRequest) XXX_Size() int {
  261. return xxx_messageInfo_QueryWriteStatusRequest.Size(m)
  262. }
  263. func (m *QueryWriteStatusRequest) XXX_DiscardUnknown() {
  264. xxx_messageInfo_QueryWriteStatusRequest.DiscardUnknown(m)
  265. }
  266. var xxx_messageInfo_QueryWriteStatusRequest proto.InternalMessageInfo
  267. func (m *QueryWriteStatusRequest) GetResourceName() string {
  268. if m != nil {
  269. return m.ResourceName
  270. }
  271. return ""
  272. }
  273. // Response object for ByteStream.QueryWriteStatus.
  274. type QueryWriteStatusResponse struct {
  275. // The number of bytes that have been processed for the given resource.
  276. CommittedSize int64 `protobuf:"varint,1,opt,name=committed_size,json=committedSize,proto3" json:"committed_size,omitempty"`
  277. // `complete` is `true` only if the client has sent a `WriteRequest` with
  278. // `finish_write` set to true, and the server has processed that request.
  279. Complete bool `protobuf:"varint,2,opt,name=complete,proto3" json:"complete,omitempty"`
  280. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  281. XXX_unrecognized []byte `json:"-"`
  282. XXX_sizecache int32 `json:"-"`
  283. }
  284. func (m *QueryWriteStatusResponse) Reset() { *m = QueryWriteStatusResponse{} }
  285. func (m *QueryWriteStatusResponse) String() string { return proto.CompactTextString(m) }
  286. func (*QueryWriteStatusResponse) ProtoMessage() {}
  287. func (*QueryWriteStatusResponse) Descriptor() ([]byte, []int) {
  288. return fileDescriptor_bytestream_e682df2b5477b695, []int{5}
  289. }
  290. func (m *QueryWriteStatusResponse) XXX_Unmarshal(b []byte) error {
  291. return xxx_messageInfo_QueryWriteStatusResponse.Unmarshal(m, b)
  292. }
  293. func (m *QueryWriteStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  294. return xxx_messageInfo_QueryWriteStatusResponse.Marshal(b, m, deterministic)
  295. }
  296. func (dst *QueryWriteStatusResponse) XXX_Merge(src proto.Message) {
  297. xxx_messageInfo_QueryWriteStatusResponse.Merge(dst, src)
  298. }
  299. func (m *QueryWriteStatusResponse) XXX_Size() int {
  300. return xxx_messageInfo_QueryWriteStatusResponse.Size(m)
  301. }
  302. func (m *QueryWriteStatusResponse) XXX_DiscardUnknown() {
  303. xxx_messageInfo_QueryWriteStatusResponse.DiscardUnknown(m)
  304. }
  305. var xxx_messageInfo_QueryWriteStatusResponse proto.InternalMessageInfo
  306. func (m *QueryWriteStatusResponse) GetCommittedSize() int64 {
  307. if m != nil {
  308. return m.CommittedSize
  309. }
  310. return 0
  311. }
  312. func (m *QueryWriteStatusResponse) GetComplete() bool {
  313. if m != nil {
  314. return m.Complete
  315. }
  316. return false
  317. }
  318. func init() {
  319. proto.RegisterType((*ReadRequest)(nil), "google.bytestream.ReadRequest")
  320. proto.RegisterType((*ReadResponse)(nil), "google.bytestream.ReadResponse")
  321. proto.RegisterType((*WriteRequest)(nil), "google.bytestream.WriteRequest")
  322. proto.RegisterType((*WriteResponse)(nil), "google.bytestream.WriteResponse")
  323. proto.RegisterType((*QueryWriteStatusRequest)(nil), "google.bytestream.QueryWriteStatusRequest")
  324. proto.RegisterType((*QueryWriteStatusResponse)(nil), "google.bytestream.QueryWriteStatusResponse")
  325. }
  326. // Reference imports to suppress errors if they are not otherwise used.
  327. var _ context.Context
  328. var _ grpc.ClientConn
  329. // This is a compile-time assertion to ensure that this generated file
  330. // is compatible with the grpc package it is being compiled against.
  331. const _ = grpc.SupportPackageIsVersion4
  332. // ByteStreamClient is the client API for ByteStream service.
  333. //
  334. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  335. type ByteStreamClient interface {
  336. // `Read()` is used to retrieve the contents of a resource as a sequence
  337. // of bytes. The bytes are returned in a sequence of responses, and the
  338. // responses are delivered as the results of a server-side streaming RPC.
  339. Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (ByteStream_ReadClient, error)
  340. // `Write()` is used to send the contents of a resource as a sequence of
  341. // bytes. The bytes are sent in a sequence of request protos of a client-side
  342. // streaming RPC.
  343. //
  344. // A `Write()` action is resumable. If there is an error or the connection is
  345. // broken during the `Write()`, the client should check the status of the
  346. // `Write()` by calling `QueryWriteStatus()` and continue writing from the
  347. // returned `committed_size`. This may be less than the amount of data the
  348. // client previously sent.
  349. //
  350. // Calling `Write()` on a resource name that was previously written and
  351. // finalized could cause an error, depending on whether the underlying service
  352. // allows over-writing of previously written resources.
  353. //
  354. // When the client closes the request channel, the service will respond with
  355. // a `WriteResponse`. The service will not view the resource as `complete`
  356. // until the client has sent a `WriteRequest` with `finish_write` set to
  357. // `true`. Sending any requests on a stream after sending a request with
  358. // `finish_write` set to `true` will cause an error. The client **should**
  359. // check the `WriteResponse` it receives to determine how much data the
  360. // service was able to commit and whether the service views the resource as
  361. // `complete` or not.
  362. Write(ctx context.Context, opts ...grpc.CallOption) (ByteStream_WriteClient, error)
  363. // `QueryWriteStatus()` is used to find the `committed_size` for a resource
  364. // that is being written, which can then be used as the `write_offset` for
  365. // the next `Write()` call.
  366. //
  367. // If the resource does not exist (i.e., the resource has been deleted, or the
  368. // first `Write()` has not yet reached the service), this method returns the
  369. // error `NOT_FOUND`.
  370. //
  371. // The client **may** call `QueryWriteStatus()` at any time to determine how
  372. // much data has been processed for this resource. This is useful if the
  373. // client is buffering data and needs to know which data can be safely
  374. // evicted. For any sequence of `QueryWriteStatus()` calls for a given
  375. // resource name, the sequence of returned `committed_size` values will be
  376. // non-decreasing.
  377. QueryWriteStatus(ctx context.Context, in *QueryWriteStatusRequest, opts ...grpc.CallOption) (*QueryWriteStatusResponse, error)
  378. }
  379. type byteStreamClient struct {
  380. cc *grpc.ClientConn
  381. }
  382. func NewByteStreamClient(cc *grpc.ClientConn) ByteStreamClient {
  383. return &byteStreamClient{cc}
  384. }
  385. func (c *byteStreamClient) Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (ByteStream_ReadClient, error) {
  386. stream, err := c.cc.NewStream(ctx, &_ByteStream_serviceDesc.Streams[0], "/google.bytestream.ByteStream/Read", opts...)
  387. if err != nil {
  388. return nil, err
  389. }
  390. x := &byteStreamReadClient{stream}
  391. if err := x.ClientStream.SendMsg(in); err != nil {
  392. return nil, err
  393. }
  394. if err := x.ClientStream.CloseSend(); err != nil {
  395. return nil, err
  396. }
  397. return x, nil
  398. }
  399. type ByteStream_ReadClient interface {
  400. Recv() (*ReadResponse, error)
  401. grpc.ClientStream
  402. }
  403. type byteStreamReadClient struct {
  404. grpc.ClientStream
  405. }
  406. func (x *byteStreamReadClient) Recv() (*ReadResponse, error) {
  407. m := new(ReadResponse)
  408. if err := x.ClientStream.RecvMsg(m); err != nil {
  409. return nil, err
  410. }
  411. return m, nil
  412. }
  413. func (c *byteStreamClient) Write(ctx context.Context, opts ...grpc.CallOption) (ByteStream_WriteClient, error) {
  414. stream, err := c.cc.NewStream(ctx, &_ByteStream_serviceDesc.Streams[1], "/google.bytestream.ByteStream/Write", opts...)
  415. if err != nil {
  416. return nil, err
  417. }
  418. x := &byteStreamWriteClient{stream}
  419. return x, nil
  420. }
  421. type ByteStream_WriteClient interface {
  422. Send(*WriteRequest) error
  423. CloseAndRecv() (*WriteResponse, error)
  424. grpc.ClientStream
  425. }
  426. type byteStreamWriteClient struct {
  427. grpc.ClientStream
  428. }
  429. func (x *byteStreamWriteClient) Send(m *WriteRequest) error {
  430. return x.ClientStream.SendMsg(m)
  431. }
  432. func (x *byteStreamWriteClient) CloseAndRecv() (*WriteResponse, error) {
  433. if err := x.ClientStream.CloseSend(); err != nil {
  434. return nil, err
  435. }
  436. m := new(WriteResponse)
  437. if err := x.ClientStream.RecvMsg(m); err != nil {
  438. return nil, err
  439. }
  440. return m, nil
  441. }
  442. func (c *byteStreamClient) QueryWriteStatus(ctx context.Context, in *QueryWriteStatusRequest, opts ...grpc.CallOption) (*QueryWriteStatusResponse, error) {
  443. out := new(QueryWriteStatusResponse)
  444. err := c.cc.Invoke(ctx, "/google.bytestream.ByteStream/QueryWriteStatus", in, out, opts...)
  445. if err != nil {
  446. return nil, err
  447. }
  448. return out, nil
  449. }
  450. // ByteStreamServer is the server API for ByteStream service.
  451. type ByteStreamServer interface {
  452. // `Read()` is used to retrieve the contents of a resource as a sequence
  453. // of bytes. The bytes are returned in a sequence of responses, and the
  454. // responses are delivered as the results of a server-side streaming RPC.
  455. Read(*ReadRequest, ByteStream_ReadServer) error
  456. // `Write()` is used to send the contents of a resource as a sequence of
  457. // bytes. The bytes are sent in a sequence of request protos of a client-side
  458. // streaming RPC.
  459. //
  460. // A `Write()` action is resumable. If there is an error or the connection is
  461. // broken during the `Write()`, the client should check the status of the
  462. // `Write()` by calling `QueryWriteStatus()` and continue writing from the
  463. // returned `committed_size`. This may be less than the amount of data the
  464. // client previously sent.
  465. //
  466. // Calling `Write()` on a resource name that was previously written and
  467. // finalized could cause an error, depending on whether the underlying service
  468. // allows over-writing of previously written resources.
  469. //
  470. // When the client closes the request channel, the service will respond with
  471. // a `WriteResponse`. The service will not view the resource as `complete`
  472. // until the client has sent a `WriteRequest` with `finish_write` set to
  473. // `true`. Sending any requests on a stream after sending a request with
  474. // `finish_write` set to `true` will cause an error. The client **should**
  475. // check the `WriteResponse` it receives to determine how much data the
  476. // service was able to commit and whether the service views the resource as
  477. // `complete` or not.
  478. Write(ByteStream_WriteServer) error
  479. // `QueryWriteStatus()` is used to find the `committed_size` for a resource
  480. // that is being written, which can then be used as the `write_offset` for
  481. // the next `Write()` call.
  482. //
  483. // If the resource does not exist (i.e., the resource has been deleted, or the
  484. // first `Write()` has not yet reached the service), this method returns the
  485. // error `NOT_FOUND`.
  486. //
  487. // The client **may** call `QueryWriteStatus()` at any time to determine how
  488. // much data has been processed for this resource. This is useful if the
  489. // client is buffering data and needs to know which data can be safely
  490. // evicted. For any sequence of `QueryWriteStatus()` calls for a given
  491. // resource name, the sequence of returned `committed_size` values will be
  492. // non-decreasing.
  493. QueryWriteStatus(context.Context, *QueryWriteStatusRequest) (*QueryWriteStatusResponse, error)
  494. }
  495. func RegisterByteStreamServer(s *grpc.Server, srv ByteStreamServer) {
  496. s.RegisterService(&_ByteStream_serviceDesc, srv)
  497. }
  498. func _ByteStream_Read_Handler(srv interface{}, stream grpc.ServerStream) error {
  499. m := new(ReadRequest)
  500. if err := stream.RecvMsg(m); err != nil {
  501. return err
  502. }
  503. return srv.(ByteStreamServer).Read(m, &byteStreamReadServer{stream})
  504. }
  505. type ByteStream_ReadServer interface {
  506. Send(*ReadResponse) error
  507. grpc.ServerStream
  508. }
  509. type byteStreamReadServer struct {
  510. grpc.ServerStream
  511. }
  512. func (x *byteStreamReadServer) Send(m *ReadResponse) error {
  513. return x.ServerStream.SendMsg(m)
  514. }
  515. func _ByteStream_Write_Handler(srv interface{}, stream grpc.ServerStream) error {
  516. return srv.(ByteStreamServer).Write(&byteStreamWriteServer{stream})
  517. }
  518. type ByteStream_WriteServer interface {
  519. SendAndClose(*WriteResponse) error
  520. Recv() (*WriteRequest, error)
  521. grpc.ServerStream
  522. }
  523. type byteStreamWriteServer struct {
  524. grpc.ServerStream
  525. }
  526. func (x *byteStreamWriteServer) SendAndClose(m *WriteResponse) error {
  527. return x.ServerStream.SendMsg(m)
  528. }
  529. func (x *byteStreamWriteServer) Recv() (*WriteRequest, error) {
  530. m := new(WriteRequest)
  531. if err := x.ServerStream.RecvMsg(m); err != nil {
  532. return nil, err
  533. }
  534. return m, nil
  535. }
  536. func _ByteStream_QueryWriteStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  537. in := new(QueryWriteStatusRequest)
  538. if err := dec(in); err != nil {
  539. return nil, err
  540. }
  541. if interceptor == nil {
  542. return srv.(ByteStreamServer).QueryWriteStatus(ctx, in)
  543. }
  544. info := &grpc.UnaryServerInfo{
  545. Server: srv,
  546. FullMethod: "/google.bytestream.ByteStream/QueryWriteStatus",
  547. }
  548. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  549. return srv.(ByteStreamServer).QueryWriteStatus(ctx, req.(*QueryWriteStatusRequest))
  550. }
  551. return interceptor(ctx, in, info, handler)
  552. }
  553. var _ByteStream_serviceDesc = grpc.ServiceDesc{
  554. ServiceName: "google.bytestream.ByteStream",
  555. HandlerType: (*ByteStreamServer)(nil),
  556. Methods: []grpc.MethodDesc{
  557. {
  558. MethodName: "QueryWriteStatus",
  559. Handler: _ByteStream_QueryWriteStatus_Handler,
  560. },
  561. },
  562. Streams: []grpc.StreamDesc{
  563. {
  564. StreamName: "Read",
  565. Handler: _ByteStream_Read_Handler,
  566. ServerStreams: true,
  567. },
  568. {
  569. StreamName: "Write",
  570. Handler: _ByteStream_Write_Handler,
  571. ClientStreams: true,
  572. },
  573. },
  574. Metadata: "google/bytestream/bytestream.proto",
  575. }
  576. func init() {
  577. proto.RegisterFile("google/bytestream/bytestream.proto", fileDescriptor_bytestream_e682df2b5477b695)
  578. }
  579. var fileDescriptor_bytestream_e682df2b5477b695 = []byte{
  580. // 446 bytes of a gzipped FileDescriptorProto
  581. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x5b, 0x8b, 0x13, 0x31,
  582. 0x14, 0x66, 0xb6, 0xab, 0x74, 0x4f, 0xa7, 0x5e, 0x02, 0xe2, 0x30, 0xe8, 0x6e, 0x77, 0x44, 0x28,
  583. 0x0a, 0x33, 0xa2, 0xe0, 0xcb, 0x82, 0x0f, 0x7d, 0x13, 0x16, 0x2f, 0xd9, 0x07, 0x41, 0x90, 0x21,
  584. 0x6d, 0x4f, 0xc7, 0x60, 0x93, 0x8c, 0x49, 0x86, 0xa5, 0xfb, 0x1f, 0x7c, 0xf1, 0x17, 0x4b, 0x92,
  585. 0xb1, 0x1d, 0x6d, 0x0b, 0xdb, 0xb7, 0xe4, 0xbb, 0xcc, 0xf9, 0xe6, 0xe4, 0x1c, 0xc8, 0x2a, 0xa5,
  586. 0xaa, 0x25, 0x16, 0xd3, 0x95, 0x45, 0x63, 0x35, 0x32, 0xd1, 0x39, 0xe6, 0xb5, 0x56, 0x56, 0x91,
  587. 0x87, 0x41, 0x93, 0x6f, 0x88, 0xf4, 0x49, 0x6b, 0x63, 0x35, 0x2f, 0x98, 0x94, 0xca, 0x32, 0xcb,
  588. 0x95, 0x34, 0xc1, 0x90, 0x9e, 0xb6, 0xac, 0xbf, 0x4d, 0x9b, 0x45, 0x71, 0xad, 0x59, 0x5d, 0xa3,
  589. 0x6e, 0xf9, 0x4c, 0xc3, 0x80, 0x22, 0x9b, 0x53, 0xfc, 0xd9, 0xa0, 0xb1, 0xe4, 0x19, 0x0c, 0x35,
  590. 0x1a, 0xd5, 0xe8, 0x19, 0x96, 0x92, 0x09, 0x4c, 0xa2, 0x51, 0x34, 0x3e, 0xa1, 0xf1, 0x5f, 0xf0,
  591. 0x03, 0x13, 0x48, 0xce, 0x60, 0xa0, 0x91, 0xcd, 0x4b, 0xb5, 0x58, 0x18, 0xb4, 0xc9, 0xd1, 0x28,
  592. 0x1a, 0xf7, 0x28, 0x38, 0xe8, 0xa3, 0x47, 0xc8, 0x53, 0xf0, 0xb7, 0x72, 0xc9, 0x05, 0xb7, 0x49,
  593. 0xcf, 0xf3, 0x27, 0x0e, 0xb9, 0x74, 0x40, 0x96, 0x41, 0x1c, 0x6a, 0x9a, 0x5a, 0x49, 0x83, 0x84,
  594. 0xc0, 0xf1, 0x9c, 0x59, 0x96, 0xc0, 0x28, 0x1a, 0xc7, 0xd4, 0x9f, 0xb3, 0x5f, 0x11, 0xc4, 0x5f,
  595. 0x34, 0xb7, 0x78, 0x50, 0xb2, 0x73, 0x88, 0xaf, 0x9d, 0xe9, 0xdf, 0x68, 0x03, 0x8f, 0xb5, 0xd9,
  596. 0xce, 0x21, 0x5e, 0x70, 0xc9, 0xcd, 0xf7, 0xd2, 0xa3, 0x3e, 0x5d, 0x9f, 0x0e, 0x02, 0xe6, 0x2b,
  597. 0xee, 0xcc, 0xf3, 0x16, 0x86, 0x6d, 0x9c, 0x36, 0xf4, 0x73, 0xb8, 0x37, 0x53, 0x42, 0x70, 0x6b,
  598. 0x71, 0x5e, 0x1a, 0x7e, 0x13, 0x02, 0xf5, 0xe8, 0x70, 0x8d, 0x5e, 0xf1, 0x1b, 0xcc, 0xde, 0xc1,
  599. 0xe3, 0xcf, 0x0d, 0xea, 0x95, 0x37, 0x5f, 0x59, 0x66, 0x1b, 0x73, 0xc8, 0x1f, 0x65, 0xdf, 0x20,
  600. 0xd9, 0xf6, 0x1f, 0x14, 0x81, 0xa4, 0xd0, 0x9f, 0x29, 0x51, 0x2f, 0xd1, 0xa2, 0x6f, 0x48, 0x9f,
  601. 0xae, 0xef, 0xaf, 0x7f, 0x1f, 0x01, 0x4c, 0x56, 0xee, 0xcb, 0x6e, 0x96, 0xc8, 0x7b, 0x38, 0x76,
  602. 0x2f, 0x43, 0x4e, 0xf3, 0xad, 0x39, 0xcb, 0x3b, 0x63, 0x92, 0x9e, 0xed, 0xe5, 0x43, 0xb4, 0x57,
  603. 0x11, 0xb9, 0x84, 0x3b, 0xa1, 0x9b, 0xbb, 0xb4, 0xdd, 0x97, 0x4d, 0x47, 0xfb, 0x05, 0xe1, 0x6b,
  604. 0xe3, 0x88, 0xfc, 0x80, 0x07, 0xff, 0xb7, 0x81, 0xbc, 0xd8, 0xe1, 0xdb, 0xd3, 0xeb, 0xf4, 0xe5,
  605. 0xad, 0xb4, 0xa1, 0xdc, 0x04, 0xe1, 0xd1, 0x4c, 0x89, 0x6d, 0xc7, 0xe4, 0xfe, 0xa6, 0x55, 0x9f,
  606. 0xdc, 0xf6, 0x7c, 0xbd, 0x68, 0x35, 0x95, 0x5a, 0x32, 0x59, 0xe5, 0x4a, 0x57, 0x45, 0x85, 0xd2,
  607. 0x6f, 0x56, 0x11, 0x28, 0x56, 0x73, 0xd3, 0x59, 0xe3, 0x8b, 0xcd, 0x71, 0x7a, 0xd7, 0xeb, 0xde,
  608. 0xfc, 0x09, 0x00, 0x00, 0xff, 0xff, 0x8f, 0x91, 0x09, 0xd4, 0xf8, 0x03, 0x00, 0x00,
  609. }