-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
35 lines (28 loc) · 795 Bytes
/
types.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
// Copyright Turing Corp. 2018 All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package rpc
import (
"github.com/turingchain2020/turingchain/common/log/log15"
"github.com/turingchain2020/turingchain/rpc/types"
pty "github.com/turingchain2020/plugin/plugin/dapp/privacy/types"
)
var log = log15.New("module", "privacy.rpc")
// Jrpc json rpc class
type Jrpc struct {
cli *channelClient
}
// Grpc grpc class
type Grpc struct {
*channelClient
}
type channelClient struct {
types.ChannelClient
}
// Init init rpc server
func Init(name string, s types.RPCServer) {
cli := &channelClient{}
grpc := &Grpc{channelClient: cli}
cli.Init(name, s, &Jrpc{cli: cli}, grpc)
pty.RegisterPrivacyServer(s.GRPC(), grpc)
}