MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / SharedRPC

Function SharedRPC

internal/rpc/rpc_utils.go:15–34  ·  view source on GitHub ↗

SharedRPC RPC对象

()

Source from the content-addressed store, hash-verified

13
14// SharedRPC RPC对象
15func SharedRPC() (*RPCClient, error) {
16 locker.Lock()
17 defer locker.Unlock()
18
19 if sharedRPC != nil {
20 return sharedRPC, nil
21 }
22
23 config, err := configs.LoadAPIConfig()
24 if err != nil {
25 return nil, err
26 }
27 client, err := NewRPCClient(config)
28 if err != nil {
29 return nil, err
30 }
31
32 sharedRPC = client
33 return sharedRPC, nil
34}
35
36// IsConnError 是否为连接错误
37func IsConnError(err error) bool {

Callers 15

uploadLogsFunction · 0.92
ProcessMethod · 0.92
LoopMethod · 0.92
UploadMethod · 0.92
UploadMethod · 0.92
fetchMethod · 0.92
updateMethod · 0.92
StartMethod · 0.92
LoopMethod · 0.92
doACMEMethod · 0.92
TestMethod · 0.92
syncConfigMethod · 0.92

Calls 4

LoadAPIConfigFunction · 0.92
NewRPCClientFunction · 0.85
LockMethod · 0.45
UnlockMethod · 0.45

Tested by 5

TestValueQueue_RPCFunction · 0.74
TestRPCConcurrentCallFunction · 0.74
TestRPC_RetryFunction · 0.74