/
server.pb.go
151 lines (133 loc) · 5.63 KB
/
server.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: grpc/proto/genesis/server.proto
package genesis
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
func init() { proto.RegisterFile("grpc/proto/genesis/server.proto", fileDescriptor_44b7aa3c708f4d23) }
var fileDescriptor_44b7aa3c708f4d23 = []byte{
// 194 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0x2f, 0x2a, 0x48,
0xd6, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2f,
0x4e, 0x2d, 0x2a, 0x4b, 0x2d, 0xd2, 0x03, 0x0b, 0x0a, 0xb1, 0x43, 0x45, 0xa5, 0xe4, 0xb0, 0xa8,
0x4c, 0xca, 0xc9, 0x4f, 0xce, 0x86, 0x28, 0x34, 0x9a, 0xc5, 0xc8, 0xc5, 0xee, 0x0e, 0x11, 0x17,
0xf2, 0xe6, 0x12, 0x72, 0x2e, 0x4a, 0x4d, 0x2c, 0x49, 0x85, 0x0a, 0x38, 0x81, 0xd4, 0x09, 0x49,
0xe8, 0x41, 0xf5, 0xe9, 0x05, 0xa5, 0x16, 0x22, 0xcb, 0x48, 0x49, 0x22, 0xc9, 0x14, 0x17, 0x20,
0x4b, 0x29, 0x31, 0x08, 0x39, 0x71, 0xf1, 0x43, 0x0c, 0x73, 0xce, 0x48, 0xcc, 0xcb, 0x4b, 0xcd,
0x09, 0xa9, 0x10, 0x12, 0x45, 0x36, 0x09, 0x2e, 0x2c, 0x25, 0x86, 0x62, 0x0c, 0x5c, 0x5c, 0x89,
0xc1, 0xc9, 0x97, 0x4b, 0x2b, 0x39, 0x4f, 0x2f, 0x31, 0x29, 0xb5, 0x28, 0x33, 0x59, 0x2f, 0x2d,
0x31, 0xa9, 0x28, 0x33, 0x59, 0x37, 0x39, 0x27, 0x33, 0x35, 0xaf, 0x44, 0x0f, 0xe4, 0x2d, 0x88,
0x17, 0x60, 0xba, 0x9d, 0xb8, 0x83, 0xc1, 0x21, 0x10, 0x00, 0x12, 0x8c, 0x12, 0xc2, 0xf4, 0x77,
0x12, 0x1b, 0x98, 0x6b, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x52, 0x58, 0xa7, 0x62, 0x3e, 0x01,
0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// GenesisClient is the client API for Genesis service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type GenesisClient interface {
// 生成创世区块
CreateGenesisBlock(ctx context.Context, in *ReqGenesisBlock, opts ...grpc.CallOption) (*RespGenesisBlock, error)
// 生成通道/账本初始区块
CreateChannelTx(ctx context.Context, in *ReqChannelTx, opts ...grpc.CallOption) (*RespChannelTx, error)
}
type genesisClient struct {
cc *grpc.ClientConn
}
func NewGenesisClient(cc *grpc.ClientConn) GenesisClient {
return &genesisClient{cc}
}
func (c *genesisClient) CreateGenesisBlock(ctx context.Context, in *ReqGenesisBlock, opts ...grpc.CallOption) (*RespGenesisBlock, error) {
out := new(RespGenesisBlock)
err := c.cc.Invoke(ctx, "/genesis.Genesis/CreateGenesisBlock", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *genesisClient) CreateChannelTx(ctx context.Context, in *ReqChannelTx, opts ...grpc.CallOption) (*RespChannelTx, error) {
out := new(RespChannelTx)
err := c.cc.Invoke(ctx, "/genesis.Genesis/CreateChannelTx", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// GenesisServer is the server API for Genesis service.
type GenesisServer interface {
// 生成创世区块
CreateGenesisBlock(context.Context, *ReqGenesisBlock) (*RespGenesisBlock, error)
// 生成通道/账本初始区块
CreateChannelTx(context.Context, *ReqChannelTx) (*RespChannelTx, error)
}
func RegisterGenesisServer(s *grpc.Server, srv GenesisServer) {
s.RegisterService(&_Genesis_serviceDesc, srv)
}
func _Genesis_CreateGenesisBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReqGenesisBlock)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GenesisServer).CreateGenesisBlock(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/genesis.Genesis/CreateGenesisBlock",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GenesisServer).CreateGenesisBlock(ctx, req.(*ReqGenesisBlock))
}
return interceptor(ctx, in, info, handler)
}
func _Genesis_CreateChannelTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReqChannelTx)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(GenesisServer).CreateChannelTx(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/genesis.Genesis/CreateChannelTx",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(GenesisServer).CreateChannelTx(ctx, req.(*ReqChannelTx))
}
return interceptor(ctx, in, info, handler)
}
var _Genesis_serviceDesc = grpc.ServiceDesc{
ServiceName: "genesis.Genesis",
HandlerType: (*GenesisServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateGenesisBlock",
Handler: _Genesis_CreateGenesisBlock_Handler,
},
{
MethodName: "CreateChannelTx",
Handler: _Genesis_CreateChannelTx_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "grpc/proto/genesis/server.proto",
}