checker.go 715 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Code generated by goctl. DO NOT EDIT!
  2. // Source: check.proto
  3. //go:generate mockgen -destination ./checker_mock.go -package checker -source $GOFILE
  4. package checker
  5. import (
  6. "context"
  7. "bookstore/rpc/check/check"
  8. "github.com/tal-tech/go-zero/zrpc"
  9. )
  10. type (
  11. CheckReq = check.CheckReq
  12. CheckResp = check.CheckResp
  13. Checker interface {
  14. Check(ctx context.Context, in *CheckReq) (*CheckResp, error)
  15. }
  16. defaultChecker struct {
  17. cli zrpc.Client
  18. }
  19. )
  20. func NewChecker(cli zrpc.Client) Checker {
  21. return &defaultChecker{
  22. cli: cli,
  23. }
  24. }
  25. func (m *defaultChecker) Check(ctx context.Context, in *CheckReq) (*CheckResp, error) {
  26. client := check.NewCheckerClient(m.cli.Conn())
  27. return client.Check(ctx, in)
  28. }