rpcbff.go 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Code generated by goctl. DO NOT EDIT!
  2. // Source: rpcbff.proto
  3. package rpcbff
  4. import (
  5. "context"
  6. "ylink/bff/rpcbff/pb"
  7. "github.com/zeromicro/go-zero/zrpc"
  8. "google.golang.org/grpc"
  9. )
  10. type (
  11. CommandReq = pb.CommandReq
  12. CommandResp = pb.CommandResp
  13. Rpcbff interface {
  14. Connect(ctx context.Context, in *CommandReq, opts ...grpc.CallOption) (pb.Rpcbff_ConnectClient, error)
  15. Disconnect(ctx context.Context, in *CommandReq, opts ...grpc.CallOption) (*CommandResp, error)
  16. }
  17. defaultRpcbff struct {
  18. cli zrpc.Client
  19. }
  20. )
  21. func NewRpcbff(cli zrpc.Client) Rpcbff {
  22. return &defaultRpcbff{
  23. cli: cli,
  24. }
  25. }
  26. func (m *defaultRpcbff) Connect(ctx context.Context, in *CommandReq, opts ...grpc.CallOption) (pb.Rpcbff_ConnectClient, error) {
  27. client := pb.NewRpcbffClient(m.cli.Conn())
  28. return client.Connect(ctx, in, opts...)
  29. }
  30. func (m *defaultRpcbff) Disconnect(ctx context.Context, in *CommandReq, opts ...grpc.CallOption) (*CommandResp, error) {
  31. client := pb.NewRpcbffClient(m.cli.Conn())
  32. return client.Disconnect(ctx, in, opts...)
  33. }