Skip to content
This repository was archived by the owner on May 14, 2022. It is now read-only.

Commit 6134f38

Browse files
committed
chore: add StackHeadRpcRequest
1 parent b22f153 commit 6134f38

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

stackhead.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ const (
77
IntCmdUninstallPkgApk string = "stackhead:uninstall:package:apk"
88
)
99

10+
type StackHeadRpcRequest struct {
11+
Command string
12+
Data interface{}
13+
}
14+
1015
func ExecCmd(command string, args ...interface{}) error {
1116
c := &gorpc.Client{Addr: "localhost:1412"}
1217
c.Start()
1318
defer c.Stop()
1419
// All client methods issuing RPCs are thread-safe and goroutine-safe,
1520
// i.e. it is safe to call them from multiple concurrently running goroutines.
16-
_, err := c.Call(command, args...)
21+
_, err := c.Call(StackHeadRpcRequest{Command: command, Data: args})
1722
return err
1823
}

0 commit comments

Comments
 (0)