blob: 4ec2cb8b1d552df20e1a2026a363c0551902348d [file] [log] [blame]
// Copyright 2015 The LUCI Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package main
import (
"context"
"fmt"
"os"
"go.chromium.org/luci/examples/appengine/helloworld_standard/proto"
"go.chromium.org/luci/grpc/prpc"
)
func main() {
ctx := context.Background()
greeter := helloworld.NewGreeterPRPCClient(&prpc.Client{Host: "https://helloworld-dot-prpc-talk.appspot.com"})
req := &helloworld.HelloRequest{}
if len(os.Args) > 1 {
req.Name = os.Args[1]
}
res, err := greeter.SayHello(ctx, req)
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
fmt.Println(res.Message)
}