Slide 11
Slide 11 text
ΠϯλϑΣΠεΛ࣮͢Δ
w &DIPؔΛ࣋ͭTUSVDUΛ࣮
w Τϥʔઐ༻ͷεςʔλεΛฦ͢
type EchoServer struct{}
func (s *EchoServer) Echo(ctx context.Context, in *pb.EchoMessage)
(*pb.EchoMessage, error) {
if in.Msg == "" {
return nil, grpc.Errorf(codes.InvalidArgument, "message is empty")
}
return &pb.EchoMessage{
Msg: in.Msg,
}, nil
}