github.com/ZihuaZhang/fabric-protos-go@v1.0.7/peer/snapshot.pb.go (about) 1 // Code generated by protoc-gen-go. DO NOT EDIT. 2 // source: peer/snapshot.proto 3 4 package peer 5 6 import ( 7 context "context" 8 fmt "fmt" 9 proto "github.com/golang/protobuf/proto" 10 common "github.com/ZihuaZhang/fabric-protos-go/common" 11 grpc "google.golang.org/grpc" 12 codes "google.golang.org/grpc/codes" 13 status "google.golang.org/grpc/status" 14 emptypb "google.golang.org/protobuf/types/known/emptypb" 15 math "math" 16 ) 17 18 // Reference imports to suppress errors if they are not otherwise used. 19 var _ = proto.Marshal 20 var _ = fmt.Errorf 21 var _ = math.Inf 22 23 // This is a compile-time assertion to ensure that this generated file 24 // is compatible with the proto package it is being compiled against. 25 // A compilation error at this line likely means your copy of the 26 // proto package needs to be updated. 27 const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 28 29 // SnapshotRequest contains information for a generate/cancel snapshot request 30 type SnapshotRequest struct { 31 // The signature header that contains creator identity and nonce 32 SignatureHeader *common.SignatureHeader `protobuf:"bytes,1,opt,name=signature_header,json=signatureHeader,proto3" json:"signature_header,omitempty"` 33 // The channel ID 34 ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` 35 // The block number to generate a snapshot 36 BlockNumber uint64 `protobuf:"varint,3,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` 37 XXX_NoUnkeyedLiteral struct{} `json:"-"` 38 XXX_unrecognized []byte `json:"-"` 39 XXX_sizecache int32 `json:"-"` 40 } 41 42 func (m *SnapshotRequest) Reset() { *m = SnapshotRequest{} } 43 func (m *SnapshotRequest) String() string { return proto.CompactTextString(m) } 44 func (*SnapshotRequest) ProtoMessage() {} 45 func (*SnapshotRequest) Descriptor() ([]byte, []int) { 46 return fileDescriptor_d05a247df97d1516, []int{0} 47 } 48 49 func (m *SnapshotRequest) XXX_Unmarshal(b []byte) error { 50 return xxx_messageInfo_SnapshotRequest.Unmarshal(m, b) 51 } 52 func (m *SnapshotRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 53 return xxx_messageInfo_SnapshotRequest.Marshal(b, m, deterministic) 54 } 55 func (m *SnapshotRequest) XXX_Merge(src proto.Message) { 56 xxx_messageInfo_SnapshotRequest.Merge(m, src) 57 } 58 func (m *SnapshotRequest) XXX_Size() int { 59 return xxx_messageInfo_SnapshotRequest.Size(m) 60 } 61 func (m *SnapshotRequest) XXX_DiscardUnknown() { 62 xxx_messageInfo_SnapshotRequest.DiscardUnknown(m) 63 } 64 65 var xxx_messageInfo_SnapshotRequest proto.InternalMessageInfo 66 67 func (m *SnapshotRequest) GetSignatureHeader() *common.SignatureHeader { 68 if m != nil { 69 return m.SignatureHeader 70 } 71 return nil 72 } 73 74 func (m *SnapshotRequest) GetChannelId() string { 75 if m != nil { 76 return m.ChannelId 77 } 78 return "" 79 } 80 81 func (m *SnapshotRequest) GetBlockNumber() uint64 { 82 if m != nil { 83 return m.BlockNumber 84 } 85 return 0 86 } 87 88 // SnapshotQuery contains information for a query snapshot request 89 type SnapshotQuery struct { 90 // The signature header that contains creator identity and nonce 91 SignatureHeader *common.SignatureHeader `protobuf:"bytes,1,opt,name=signature_header,json=signatureHeader,proto3" json:"signature_header,omitempty"` 92 // The channel ID 93 ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` 94 XXX_NoUnkeyedLiteral struct{} `json:"-"` 95 XXX_unrecognized []byte `json:"-"` 96 XXX_sizecache int32 `json:"-"` 97 } 98 99 func (m *SnapshotQuery) Reset() { *m = SnapshotQuery{} } 100 func (m *SnapshotQuery) String() string { return proto.CompactTextString(m) } 101 func (*SnapshotQuery) ProtoMessage() {} 102 func (*SnapshotQuery) Descriptor() ([]byte, []int) { 103 return fileDescriptor_d05a247df97d1516, []int{1} 104 } 105 106 func (m *SnapshotQuery) XXX_Unmarshal(b []byte) error { 107 return xxx_messageInfo_SnapshotQuery.Unmarshal(m, b) 108 } 109 func (m *SnapshotQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 110 return xxx_messageInfo_SnapshotQuery.Marshal(b, m, deterministic) 111 } 112 func (m *SnapshotQuery) XXX_Merge(src proto.Message) { 113 xxx_messageInfo_SnapshotQuery.Merge(m, src) 114 } 115 func (m *SnapshotQuery) XXX_Size() int { 116 return xxx_messageInfo_SnapshotQuery.Size(m) 117 } 118 func (m *SnapshotQuery) XXX_DiscardUnknown() { 119 xxx_messageInfo_SnapshotQuery.DiscardUnknown(m) 120 } 121 122 var xxx_messageInfo_SnapshotQuery proto.InternalMessageInfo 123 124 func (m *SnapshotQuery) GetSignatureHeader() *common.SignatureHeader { 125 if m != nil { 126 return m.SignatureHeader 127 } 128 return nil 129 } 130 131 func (m *SnapshotQuery) GetChannelId() string { 132 if m != nil { 133 return m.ChannelId 134 } 135 return "" 136 } 137 138 // SignedSnapshotRequest contains marshalled request bytes and signature 139 type SignedSnapshotRequest struct { 140 // The bytes of SnapshotRequest or SnapshotQuery 141 Request []byte `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` 142 // Signaure over request bytes; this signature is to be verified against the client identity 143 Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` 144 XXX_NoUnkeyedLiteral struct{} `json:"-"` 145 XXX_unrecognized []byte `json:"-"` 146 XXX_sizecache int32 `json:"-"` 147 } 148 149 func (m *SignedSnapshotRequest) Reset() { *m = SignedSnapshotRequest{} } 150 func (m *SignedSnapshotRequest) String() string { return proto.CompactTextString(m) } 151 func (*SignedSnapshotRequest) ProtoMessage() {} 152 func (*SignedSnapshotRequest) Descriptor() ([]byte, []int) { 153 return fileDescriptor_d05a247df97d1516, []int{2} 154 } 155 156 func (m *SignedSnapshotRequest) XXX_Unmarshal(b []byte) error { 157 return xxx_messageInfo_SignedSnapshotRequest.Unmarshal(m, b) 158 } 159 func (m *SignedSnapshotRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 160 return xxx_messageInfo_SignedSnapshotRequest.Marshal(b, m, deterministic) 161 } 162 func (m *SignedSnapshotRequest) XXX_Merge(src proto.Message) { 163 xxx_messageInfo_SignedSnapshotRequest.Merge(m, src) 164 } 165 func (m *SignedSnapshotRequest) XXX_Size() int { 166 return xxx_messageInfo_SignedSnapshotRequest.Size(m) 167 } 168 func (m *SignedSnapshotRequest) XXX_DiscardUnknown() { 169 xxx_messageInfo_SignedSnapshotRequest.DiscardUnknown(m) 170 } 171 172 var xxx_messageInfo_SignedSnapshotRequest proto.InternalMessageInfo 173 174 func (m *SignedSnapshotRequest) GetRequest() []byte { 175 if m != nil { 176 return m.Request 177 } 178 return nil 179 } 180 181 func (m *SignedSnapshotRequest) GetSignature() []byte { 182 if m != nil { 183 return m.Signature 184 } 185 return nil 186 } 187 188 // QueryPendingSnapshotsResponse specifies the response payload of a query pending snapshots request 189 type QueryPendingSnapshotsResponse struct { 190 BlockNumbers []uint64 `protobuf:"varint,1,rep,packed,name=block_numbers,json=blockNumbers,proto3" json:"block_numbers,omitempty"` 191 XXX_NoUnkeyedLiteral struct{} `json:"-"` 192 XXX_unrecognized []byte `json:"-"` 193 XXX_sizecache int32 `json:"-"` 194 } 195 196 func (m *QueryPendingSnapshotsResponse) Reset() { *m = QueryPendingSnapshotsResponse{} } 197 func (m *QueryPendingSnapshotsResponse) String() string { return proto.CompactTextString(m) } 198 func (*QueryPendingSnapshotsResponse) ProtoMessage() {} 199 func (*QueryPendingSnapshotsResponse) Descriptor() ([]byte, []int) { 200 return fileDescriptor_d05a247df97d1516, []int{3} 201 } 202 203 func (m *QueryPendingSnapshotsResponse) XXX_Unmarshal(b []byte) error { 204 return xxx_messageInfo_QueryPendingSnapshotsResponse.Unmarshal(m, b) 205 } 206 func (m *QueryPendingSnapshotsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 207 return xxx_messageInfo_QueryPendingSnapshotsResponse.Marshal(b, m, deterministic) 208 } 209 func (m *QueryPendingSnapshotsResponse) XXX_Merge(src proto.Message) { 210 xxx_messageInfo_QueryPendingSnapshotsResponse.Merge(m, src) 211 } 212 func (m *QueryPendingSnapshotsResponse) XXX_Size() int { 213 return xxx_messageInfo_QueryPendingSnapshotsResponse.Size(m) 214 } 215 func (m *QueryPendingSnapshotsResponse) XXX_DiscardUnknown() { 216 xxx_messageInfo_QueryPendingSnapshotsResponse.DiscardUnknown(m) 217 } 218 219 var xxx_messageInfo_QueryPendingSnapshotsResponse proto.InternalMessageInfo 220 221 func (m *QueryPendingSnapshotsResponse) GetBlockNumbers() []uint64 { 222 if m != nil { 223 return m.BlockNumbers 224 } 225 return nil 226 } 227 228 func init() { 229 proto.RegisterType((*SnapshotRequest)(nil), "protos.SnapshotRequest") 230 proto.RegisterType((*SnapshotQuery)(nil), "protos.SnapshotQuery") 231 proto.RegisterType((*SignedSnapshotRequest)(nil), "protos.SignedSnapshotRequest") 232 proto.RegisterType((*QueryPendingSnapshotsResponse)(nil), "protos.QueryPendingSnapshotsResponse") 233 } 234 235 func init() { proto.RegisterFile("peer/snapshot.proto", fileDescriptor_d05a247df97d1516) } 236 237 var fileDescriptor_d05a247df97d1516 = []byte{ 238 // 398 bytes of a gzipped FileDescriptorProto 239 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x53, 0xcb, 0x8e, 0xd3, 0x30, 240 0x14, 0x9d, 0x30, 0xa3, 0x61, 0x7a, 0x27, 0x55, 0x91, 0x2b, 0x20, 0x2a, 0x54, 0x0a, 0x41, 0x48, 241 0x59, 0x50, 0x47, 0x2a, 0x5f, 0x40, 0x0b, 0x02, 0x36, 0x3c, 0xdc, 0x05, 0x12, 0x9b, 0x2a, 0x8f, 242 0x5b, 0x27, 0x22, 0xb1, 0x83, 0x9d, 0x2c, 0xfa, 0x25, 0x7c, 0x24, 0x3f, 0x81, 0x62, 0xd7, 0x10, 243 0x10, 0x02, 0x89, 0xc5, 0xac, 0x1c, 0x9f, 0x7b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 0x14, 0x45, 0x25, 0xb8, 255 0x93, 0xd5, 0x0c, 0x75, 0x2b, 0x85, 0x46, 0xf2, 0x18, 0xa6, 0xe3, 0x20, 0x74, 0xe0, 0x85, 0xe7, 256 0xf1, 0x05, 0xf3, 0x47, 0x49, 0xe8, 0xf5, 0x37, 0x0f, 0xae, 0xdc, 0x51, 0xb2, 0x85, 0xab, 0x57, 257 0x28, 0x50, 0xa5, 0x1d, 0x92, 0xa5, 0x7d, 0x45, 0x4d, 0xff, 0xe8, 0x7a, 0x71, 0x8f, 0xda, 0x7e, 258 0xa0, 0xae, 0x1f, 0xe8, 0xcb, 0xa1, 0x1f, 0xa2, 0x33, 0xf2, 0x1c, 0x2e, 0xb7, 0xa9, 0xc8, 0xb1, 259 0xfe, 0x7f, 0x89, 0x8f, 0x30, 0x1d, 0xff, 0x9a, 0xfe, 0x97, 0xd2, 0x13, 0x57, 0xfe, 0x6b, 0x20, 260 0xd1, 0xd9, 0x86, 0x41, 0x24, 0x15, 0xa7, 0xe5, 0xb1, 0x45, 0x55, 0x63, 0xc1, 0x51, 0xd1, 0x43, 261 0x9a, 0xa9, 0x2a, 0x77, 0x02, 0xc3, 0x04, 0x7c, 0x7a, 0xca, 0xab, 0xae, 0xec, 0xb3, 0xe1, 0xe5, 262 0x93, 0x11, 0x35, 0xb1, 0xd4, 0x95, 0xa5, 0xae, 0xb8, 0x4c, 0x06, 0x76, 0x66, 0x07, 0xe4, 0xd9, 263 0xf7, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2f, 0x39, 0x38, 0xb5, 0x3e, 0x03, 0x00, 0x00, 264 } 265 266 // Reference imports to suppress errors if they are not otherwise used. 267 var _ context.Context 268 var _ grpc.ClientConn 269 270 // This is a compile-time assertion to ensure that this generated file 271 // is compatible with the grpc package it is being compiled against. 272 const _ = grpc.SupportPackageIsVersion4 273 274 // SnapshotClient is the client API for Snapshot service. 275 // 276 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 277 type SnapshotClient interface { 278 // Generate a snapshot reqeust. SignedSnapshotRequest contains marshalled bytes for SnaphostRequest 279 Generate(ctx context.Context, in *SignedSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) 280 // Cancel a snapshot reqeust. SignedSnapshotRequest contains marshalled bytes for SnaphostRequest 281 Cancel(ctx context.Context, in *SignedSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) 282 // Query pending snapshots query. SignedSnapshotRequest contains marshalled bytes for SnaphostQuery 283 QueryPendings(ctx context.Context, in *SignedSnapshotRequest, opts ...grpc.CallOption) (*QueryPendingSnapshotsResponse, error) 284 } 285 286 type snapshotClient struct { 287 cc *grpc.ClientConn 288 } 289 290 func NewSnapshotClient(cc *grpc.ClientConn) SnapshotClient { 291 return &snapshotClient{cc} 292 } 293 294 func (c *snapshotClient) Generate(ctx context.Context, in *SignedSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { 295 out := new(emptypb.Empty) 296 err := c.cc.Invoke(ctx, "/protos.Snapshot/Generate", in, out, opts...) 297 if err != nil { 298 return nil, err 299 } 300 return out, nil 301 } 302 303 func (c *snapshotClient) Cancel(ctx context.Context, in *SignedSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { 304 out := new(emptypb.Empty) 305 err := c.cc.Invoke(ctx, "/protos.Snapshot/Cancel", in, out, opts...) 306 if err != nil { 307 return nil, err 308 } 309 return out, nil 310 } 311 312 func (c *snapshotClient) QueryPendings(ctx context.Context, in *SignedSnapshotRequest, opts ...grpc.CallOption) (*QueryPendingSnapshotsResponse, error) { 313 out := new(QueryPendingSnapshotsResponse) 314 err := c.cc.Invoke(ctx, "/protos.Snapshot/QueryPendings", in, out, opts...) 315 if err != nil { 316 return nil, err 317 } 318 return out, nil 319 } 320 321 // SnapshotServer is the server API for Snapshot service. 322 type SnapshotServer interface { 323 // Generate a snapshot reqeust. SignedSnapshotRequest contains marshalled bytes for SnaphostRequest 324 Generate(context.Context, *SignedSnapshotRequest) (*emptypb.Empty, error) 325 // Cancel a snapshot reqeust. SignedSnapshotRequest contains marshalled bytes for SnaphostRequest 326 Cancel(context.Context, *SignedSnapshotRequest) (*emptypb.Empty, error) 327 // Query pending snapshots query. SignedSnapshotRequest contains marshalled bytes for SnaphostQuery 328 QueryPendings(context.Context, *SignedSnapshotRequest) (*QueryPendingSnapshotsResponse, error) 329 } 330 331 // UnimplementedSnapshotServer can be embedded to have forward compatible implementations. 332 type UnimplementedSnapshotServer struct { 333 } 334 335 func (*UnimplementedSnapshotServer) Generate(ctx context.Context, req *SignedSnapshotRequest) (*emptypb.Empty, error) { 336 return nil, status.Errorf(codes.Unimplemented, "method Generate not implemented") 337 } 338 func (*UnimplementedSnapshotServer) Cancel(ctx context.Context, req *SignedSnapshotRequest) (*emptypb.Empty, error) { 339 return nil, status.Errorf(codes.Unimplemented, "method Cancel not implemented") 340 } 341 func (*UnimplementedSnapshotServer) QueryPendings(ctx context.Context, req *SignedSnapshotRequest) (*QueryPendingSnapshotsResponse, error) { 342 return nil, status.Errorf(codes.Unimplemented, "method QueryPendings not implemented") 343 } 344 345 func RegisterSnapshotServer(s *grpc.Server, srv SnapshotServer) { 346 s.RegisterService(&_Snapshot_serviceDesc, srv) 347 } 348 349 func _Snapshot_Generate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 350 in := new(SignedSnapshotRequest) 351 if err := dec(in); err != nil { 352 return nil, err 353 } 354 if interceptor == nil { 355 return srv.(SnapshotServer).Generate(ctx, in) 356 } 357 info := &grpc.UnaryServerInfo{ 358 Server: srv, 359 FullMethod: "/protos.Snapshot/Generate", 360 } 361 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 362 return srv.(SnapshotServer).Generate(ctx, req.(*SignedSnapshotRequest)) 363 } 364 return interceptor(ctx, in, info, handler) 365 } 366 367 func _Snapshot_Cancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 368 in := new(SignedSnapshotRequest) 369 if err := dec(in); err != nil { 370 return nil, err 371 } 372 if interceptor == nil { 373 return srv.(SnapshotServer).Cancel(ctx, in) 374 } 375 info := &grpc.UnaryServerInfo{ 376 Server: srv, 377 FullMethod: "/protos.Snapshot/Cancel", 378 } 379 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 380 return srv.(SnapshotServer).Cancel(ctx, req.(*SignedSnapshotRequest)) 381 } 382 return interceptor(ctx, in, info, handler) 383 } 384 385 func _Snapshot_QueryPendings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 386 in := new(SignedSnapshotRequest) 387 if err := dec(in); err != nil { 388 return nil, err 389 } 390 if interceptor == nil { 391 return srv.(SnapshotServer).QueryPendings(ctx, in) 392 } 393 info := &grpc.UnaryServerInfo{ 394 Server: srv, 395 FullMethod: "/protos.Snapshot/QueryPendings", 396 } 397 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 398 return srv.(SnapshotServer).QueryPendings(ctx, req.(*SignedSnapshotRequest)) 399 } 400 return interceptor(ctx, in, info, handler) 401 } 402 403 var _Snapshot_serviceDesc = grpc.ServiceDesc{ 404 ServiceName: "protos.Snapshot", 405 HandlerType: (*SnapshotServer)(nil), 406 Methods: []grpc.MethodDesc{ 407 { 408 MethodName: "Generate", 409 Handler: _Snapshot_Generate_Handler, 410 }, 411 { 412 MethodName: "Cancel", 413 Handler: _Snapshot_Cancel_Handler, 414 }, 415 { 416 MethodName: "QueryPendings", 417 Handler: _Snapshot_QueryPendings_Handler, 418 }, 419 }, 420 Streams: []grpc.StreamDesc{}, 421 Metadata: "peer/snapshot.proto", 422 }