rcvr.go 613 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2019 github.com. All rights reserved.
  2. // Use of this source code is governed by github.com.
  3. package impl
  4. /*
  5. import (
  6. "context"
  7. "tower-monitor/pb"
  8. "tower-monitor/pb/v1"
  9. "tower-monitor/impl/v1/user"
  10. "github.com/jaryhe/gopkgs/tasker/rpctasker"
  11. "google.golang.org/grpc"
  12. )
  13. type Rcvr struct {
  14. }
  15. func Register(s *grpc.Server) {
  16. pb.RegisterSmartSiteAgentServer(s, &Rcvr{})
  17. }
  18. func (c *Rcvr) Login(ctx context.Context, req *v1.LoginRequest) (reply *v1.LoginReply, err error) {
  19. t1 := func() error {
  20. reply, err = user.Login(ctx, req)
  21. return err
  22. }
  23. return reply, rpctasker.Exec(ctx, t1)
  24. }
  25. */