-
Notifications
You must be signed in to change notification settings - Fork 28
/
simple.go
34 lines (28 loc) · 883 Bytes
/
simple.go
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
// Copyright 2021 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Command simple is a client for the Simple service.
package main
import (
"flag"
"os"
v23 "v.io/v23"
_ "v.io/x/ref/runtime/factories/static"
"v.io/x/ref/test/compatibility/modules/simple/impl"
)
var (
nameFlag, msgFlag string
numCallsFlag int
)
func init() {
flag.StringVar(&nameFlag, "name", os.ExpandEnv("users/${USER}/simpled"), "name of the server to connect to")
flag.StringVar(&msgFlag, "message", "hello", "message to ping the server with")
flag.IntVar(&numCallsFlag, "num-calls", 2, "number of RPC calls to make to the server")
}
func main() {
ctx, shutdown := v23.Init()
defer shutdown()
if err := impl.RunClient(ctx, nameFlag, msgFlag, numCallsFlag); err != nil {
panic(err)
}
}