20 lines
481 B
Go
20 lines
481 B
Go
|
package testdata
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"fmt"
|
||
|
)
|
||
|
|
||
|
type TestServiceImpl struct{}
|
||
|
|
||
|
func (e TestServiceImpl) Echo(_ context.Context, req *EchoRequest) (*EchoResponse, error) {
|
||
|
return &EchoResponse{Message: req.Message}, nil
|
||
|
}
|
||
|
|
||
|
func (e TestServiceImpl) SayHello(_ context.Context, request *SayHelloRequest) (*SayHelloResponse, error) {
|
||
|
greeting := fmt.Sprintf("Hello %s!", request.Name)
|
||
|
return &SayHelloResponse{Greeting: greeting}, nil
|
||
|
}
|
||
|
|
||
|
var _ TestServiceServer = TestServiceImpl{}
|