// Code generated by protoc-gen-micro. DO NOT EDIT. // source: user.proto package proto import ( fmt "fmt" proto "google.golang.org/protobuf/proto" math "math" ) import ( context "context" api "go-micro.dev/v4/api" client "go-micro.dev/v4/client" server "go-micro.dev/v4/server" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // Reference imports to suppress errors if they are not otherwise used. var _ api.Endpoint var _ context.Context var _ client.Option var _ server.Option // Api Endpoints for Login service func NewLoginEndpoints() []*api.Endpoint { return []*api.Endpoint{} } // Client API for Login service type LoginService interface { // rpc 服务 Login(ctx context.Context, in *LoginRequest, opts ...client.CallOption) (*LoginResp, error) } type loginService struct { c client.Client name string } func NewLoginService(name string, c client.Client) LoginService { return &loginService{ c: c, name: name, } } func (c *loginService) Login(ctx context.Context, in *LoginRequest, opts ...client.CallOption) (*LoginResp, error) { req := c.c.NewRequest(c.name, "Login.Login", in) out := new(LoginResp) err := c.c.Call(ctx, req, out, opts...) if err != nil { return nil, err } return out, nil } // Server API for Login service type LoginHandler interface { // rpc 服务 Login(context.Context, *LoginRequest, *LoginResp) error } func RegisterLoginHandler(s server.Server, hdlr LoginHandler, opts ...server.HandlerOption) error { type login interface { Login(ctx context.Context, in *LoginRequest, out *LoginResp) error } type Login struct { login } h := &loginHandler{hdlr} return s.Handle(s.NewHandler(&Login{h}, opts...)) } type loginHandler struct { LoginHandler } func (h *loginHandler) Login(ctx context.Context, in *LoginRequest, out *LoginResp) error { return h.LoginHandler.Login(ctx, in, out) } // Api Endpoints for GetUserToken service func NewGetUserTokenEndpoints() []*api.Endpoint { return []*api.Endpoint{} } // Client API for GetUserToken service type GetUserTokenService interface { // rpc 服务 GetUserToken(ctx context.Context, in *TokenReq, opts ...client.CallOption) (*TokenResp, error) } type getUserTokenService struct { c client.Client name string } func NewGetUserTokenService(name string, c client.Client) GetUserTokenService { return &getUserTokenService{ c: c, name: name, } } func (c *getUserTokenService) GetUserToken(ctx context.Context, in *TokenReq, opts ...client.CallOption) (*TokenResp, error) { req := c.c.NewRequest(c.name, "GetUserToken.GetUserToken", in) out := new(TokenResp) err := c.c.Call(ctx, req, out, opts...) if err != nil { return nil, err } return out, nil } // Server API for GetUserToken service type GetUserTokenHandler interface { // rpc 服务 GetUserToken(context.Context, *TokenReq, *TokenResp) error } func RegisterGetUserTokenHandler(s server.Server, hdlr GetUserTokenHandler, opts ...server.HandlerOption) error { type getUserToken interface { GetUserToken(ctx context.Context, in *TokenReq, out *TokenResp) error } type GetUserToken struct { getUserToken } h := &getUserTokenHandler{hdlr} return s.Handle(s.NewHandler(&GetUserToken{h}, opts...)) } type getUserTokenHandler struct { GetUserTokenHandler } func (h *getUserTokenHandler) GetUserToken(ctx context.Context, in *TokenReq, out *TokenResp) error { return h.GetUserTokenHandler.GetUserToken(ctx, in, out) }