-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexport.go
More file actions
123 lines (93 loc) · 2.26 KB
/
Copy pathexport.go
File metadata and controls
123 lines (93 loc) · 2.26 KB
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
// Package rpc provides the necessary struct and functions required to use rpc
// service.
//
// The full document is located at https://github.com/rpccloud/rpc/blob/master/doc/rpc/index.md
package rpc
import (
"crypto/tls"
"github.com/rpccloud/rpc/internal/base"
"github.com/rpccloud/rpc/internal/client"
"github.com/rpccloud/rpc/internal/rpc"
"github.com/rpccloud/rpc/internal/server"
)
// Bool ...
type Bool = rpc.Bool
// Int64 ...
type Int64 = rpc.Int64
// Uint64 ...
type Uint64 = rpc.Uint64
// Float64 ...
type Float64 = rpc.Float64
// String ...
type String = rpc.String
// Bytes ...
type Bytes = rpc.Bytes
// Array common Array type
type Array = rpc.Array
// Map common Map type
type Map = rpc.Map
// Any common Any type
type Any = rpc.Any
// RTValue ...
type RTValue = rpc.RTValue
// RTArray ...
type RTArray = rpc.RTArray
// RTMap ...
type RTMap = rpc.RTMap
// Return ...
type Return = rpc.Return
// Runtime ...
type Runtime = rpc.Runtime
// Stream ...
type Stream = rpc.Stream
// ActionCache ...
type ActionCache = rpc.ActionCache
// ActionCacheFunc ...
type ActionCacheFunc = rpc.ActionCacheFunc
// Service ...
type Service = rpc.Service
// NewService ...
func NewService(config rpc.Map) *Service {
return rpc.NewService(config)
}
// Server ...
type Server = server.Server
// ServerConfig ...
type ServerConfig = server.ServerConfig
// GetDefaultServerConfig ...
func GetDefaultServerConfig() *ServerConfig {
return server.GetDefaultServerConfig()
}
// IStreamReceiver ...
type IStreamReceiver = rpc.IStreamReceiver
// NewServer ...
func NewServer(config *ServerConfig) *Server {
return server.NewServer(config)
}
// Client ...
type Client = client.Client
// NewClient ...
func NewClient(
network string,
addr string,
path string,
tlsConfig *tls.Config,
rBufSize int,
wBufSize int,
onError func(err *base.Error),
) *Client {
return client.NewClient(
network, addr, path, tlsConfig, rBufSize, wBufSize, onError,
)
}
// GetServerTLSConfig ...
func GetServerTLSConfig(certFile string, keyFile string) (*tls.Config, error) {
return base.GetServerTLSConfig(certFile, keyFile)
}
// GetClientTLSConfig ...
func GetClientTLSConfig(
verifyServerCert bool,
caFiles []string,
) (*tls.Config, error) {
return base.GetClientTLSConfig(verifyServerCert, caFiles)
}