-
Notifications
You must be signed in to change notification settings - Fork 0
/
grpc.go
94 lines (76 loc) · 2.87 KB
/
grpc.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
/*
* Copyright (c) 2020. Aberic - All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package core
import (
"context"
"github.com/aberic/fabric-client-go/grpc/proto/core"
)
// Peer Peer
type Peer struct{}
// Installed Installed
func (p *Peer) Installed(_ context.Context, req *core.ReqPeerInstalled) (*core.RespPeerInstalled, error) {
return PeerQueryInstalled(req)
}
// Instantiated Instantiated
func (p *Peer) Instantiated(_ context.Context, req *core.ReqPeerInstantiated) (*core.RespPeerInstantiated, error) {
return PeerQueryInstantiated(req)
}
// Channel Channel
type Channel struct{}
// Create Create
func (c *Channel) Create(_ context.Context, req *core.ReqChannelCreate) (*core.RespChannelCreate, error) {
return ChannelCreate(req)
}
// Join Join
func (c *Channel) Join(_ context.Context, req *core.ReqChannelJoin) (*core.RespChannelJoin, error) {
return ChannelJoin(req)
}
// List List
func (c *Channel) List(_ context.Context, req *core.ReqChannelList) (*core.RespChannelList, error) {
return ChannelList(req)
}
// Config Config
func (c *Channel) Config(_ context.Context, req *core.ReqChannelConfigBlock) (*core.RespChannelConfigBlock, error) {
return ChannelConfigBlock(req)
}
// Update Update
func (c *Channel) Update(_ context.Context, req *core.ReqChannelUpdateBlock) (*core.RespChannelUpdateBlock, error) {
return ChannelUpdateConfigBlock(req)
}
// Sign Sign
func (c *Channel) Sign(_ context.Context, req *core.ReqChannelSign) (*core.RespChannelSign, error) {
return ChannelSign(req)
}
// ChainCode ChainCode
type ChainCode struct{}
// Install Install
func (c *ChainCode) Install(_ context.Context, req *core.ReqChainCodeInstall) (*core.RespChainCodeInstall, error) {
return ChainCodeInstall(req)
}
// Instantiate Instantiate
func (c *ChainCode) Instantiate(_ context.Context, req *core.ReqChainCodeInstantiate) (*core.RespChainCodeInstantiate, error) {
return ChainCodeInstantiate(req)
}
// Upgrade Upgrade
func (c *ChainCode) Upgrade(_ context.Context, req *core.ReqChainCodeUpgrade) (*core.RespChainCodeUpgrade, error) {
return ChainCodeUpgrade(req)
}
// Invoke Invoke
func (c *ChainCode) Invoke(_ context.Context, req *core.ReqChainCodeInvoke) (*core.RespChainCodeInvoke, error) {
return ChainCodeInvoke(req)
}
// Query Query
func (c *ChainCode) Query(_ context.Context, req *core.ReqChainCodeQuery) (*core.RespChainCodeQuery, error) {
return ChainCodeQuery(req)
}