greet.go 768 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // Code generated by goctl. DO NOT EDIT!
  2. // Source: hello.proto
  3. package client
  4. import (
  5. "context"
  6. "github.com/wuntsong-org/go-zero-plus/tools/goctlwt/example/rpc/hello/pb/hello"
  7. "github.com/wuntsong-org/go-zero-plus/zrpc"
  8. "google.golang.org/grpc"
  9. )
  10. type (
  11. HelloReq = hello.HelloReq
  12. HelloResp = hello.HelloResp
  13. Greet interface {
  14. SayHello(ctx context.Context, in *HelloReq, opts ...grpc.CallOption) (*HelloResp, error)
  15. }
  16. defaultGreet struct {
  17. cli zrpc.Client
  18. }
  19. )
  20. func NewGreet(cli zrpc.Client) Greet {
  21. return &defaultGreet{
  22. cli: cli,
  23. }
  24. }
  25. func (m *defaultGreet) SayHello(ctx context.Context, in *HelloReq, opts ...grpc.CallOption) (*HelloResp, error) {
  26. client := hello.NewGreetClient(m.cli.Conn())
  27. return client.SayHello(ctx, in, opts...)
  28. }