MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / Do

Method Do

IceFireDB-PubSub/test/proto/client.go:43–65  ·  view source on GitHub ↗
(cmd ...string)

Source from the content-addressed store, hash-verified

41}
42
43func (c *Client) Do(cmd ...string) (string, error) {
44 if err := Write(c.c, cmd); err != nil {
45 if err, ok := err.(*net.OpError); ok {
46 fmt.Println("net op err ", err.Err.Error())
47 if err.Err.Error() == "use of closed network connection" || err.Err.Error() == "write: broken pipe" {
48 conn, err := net.Dial("tcp", c.c.RemoteAddr().String())
49 if err != nil {
50 return "", err
51 }
52 c.c = conn
53 if err := Write(c.c, cmd); err != nil {
54 return "", err
55 }
56 } else {
57 return "", err
58 }
59 } else {
60 return "", err
61 }
62 }
63
64 return Read(c.r)
65}
66
67func (c *Client) Read() (string, error) {
68 return Read(c.r)

Callers 15

DoStringsMethod · 0.95
getTestConnFunction · 0.45
testListIndexFunction · 0.45
testListRangeFunction · 0.45
TestListFunction · 0.45
TestListMPushFunction · 0.45
TestPopFunction · 0.45
TestRPopLPushFunction · 0.45
TestTrimFunction · 0.45
TestListErrorParamsFunction · 0.45
TestDBSetFunction · 0.45

Calls 4

WriteFunction · 0.70
ReadFunction · 0.70
StringMethod · 0.65
ErrorMethod · 0.45

Tested by 15

getTestConnFunction · 0.36
testListIndexFunction · 0.36
testListRangeFunction · 0.36
TestListFunction · 0.36
TestListMPushFunction · 0.36
TestPopFunction · 0.36
TestRPopLPushFunction · 0.36
TestTrimFunction · 0.36
TestListErrorParamsFunction · 0.36
TestDBSetFunction · 0.36
TestSKeyExistsFunction · 0.36