MCPcopy Index your code
hub / github.com/koding/kite / main

Function main

examples/math/math-cli/math.go:13–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11var arg = flag.Int("arg", 4, "An argument to send to the kite server.")
12
13func main() {
14 flag.Parse()
15
16 // Create a kite.
17 k := kite.New("exp2", "1.0.0")
18
19 // Connect to our math kite.
20 mathWorker := k.NewClient(math.Host.URL.String())
21 err := mathWorker.Dial()
22 if err != nil {
23 panic(err)
24 }
25
26 // Call square method with the given argument.
27
28 response, err := mathWorker.Tell("square", &math.Request{
29 Number: *arg,
30 Name: "math-cli",
31 })
32 if err != nil {
33 panic(err)
34 }
35
36 fmt.Println("result:", response.MustFloat64())
37}

Callers

nothing calls this directly

Calls 5

DialMethod · 0.95
TellMethod · 0.95
NewClientMethod · 0.80
MustFloat64Method · 0.80
StringMethod · 0.45

Tested by

no test coverage detected