281 lines
11 KiB
Go
281 lines
11 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
|
|
package authpb
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
|
)
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
const _ = grpc.SupportPackageIsVersion7
|
|
|
|
// AuthServiceClient is the client API for AuthService service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
type AuthServiceClient interface {
|
|
GetCodeURL(ctx context.Context, in *GetCodeURLRequest, opts ...grpc.CallOption) (*GetCodeURLResponse, error)
|
|
ExchangeToken(ctx context.Context, in *ExchangeTokenRequest, opts ...grpc.CallOption) (*ExchangeTokenResponse, error)
|
|
RefreshToken(ctx context.Context, in *RefreshTokenRequest, opts ...grpc.CallOption) (*RefreshTokenResponse, error)
|
|
GetUserinfo(ctx context.Context, in *GetUserinfoRequest, opts ...grpc.CallOption) (*GetUserinfoResponse, error)
|
|
// synchronize userinfo when its updated
|
|
SyncUserinfo(ctx context.Context, in *SyncUserinfoRequest, opts ...grpc.CallOption) (*SyncUserinfoResponse, error)
|
|
GetClientCredential(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetClientCredentialResponse, error)
|
|
}
|
|
|
|
type authServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient {
|
|
return &authServiceClient{cc}
|
|
}
|
|
|
|
func (c *authServiceClient) GetCodeURL(ctx context.Context, in *GetCodeURLRequest, opts ...grpc.CallOption) (*GetCodeURLResponse, error) {
|
|
out := new(GetCodeURLResponse)
|
|
err := c.cc.Invoke(ctx, "/lab.weixin.mp.auth.AuthService/GetCodeURL", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *authServiceClient) ExchangeToken(ctx context.Context, in *ExchangeTokenRequest, opts ...grpc.CallOption) (*ExchangeTokenResponse, error) {
|
|
out := new(ExchangeTokenResponse)
|
|
err := c.cc.Invoke(ctx, "/lab.weixin.mp.auth.AuthService/ExchangeToken", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *authServiceClient) RefreshToken(ctx context.Context, in *RefreshTokenRequest, opts ...grpc.CallOption) (*RefreshTokenResponse, error) {
|
|
out := new(RefreshTokenResponse)
|
|
err := c.cc.Invoke(ctx, "/lab.weixin.mp.auth.AuthService/RefreshToken", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *authServiceClient) GetUserinfo(ctx context.Context, in *GetUserinfoRequest, opts ...grpc.CallOption) (*GetUserinfoResponse, error) {
|
|
out := new(GetUserinfoResponse)
|
|
err := c.cc.Invoke(ctx, "/lab.weixin.mp.auth.AuthService/GetUserinfo", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *authServiceClient) SyncUserinfo(ctx context.Context, in *SyncUserinfoRequest, opts ...grpc.CallOption) (*SyncUserinfoResponse, error) {
|
|
out := new(SyncUserinfoResponse)
|
|
err := c.cc.Invoke(ctx, "/lab.weixin.mp.auth.AuthService/SyncUserinfo", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *authServiceClient) GetClientCredential(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetClientCredentialResponse, error) {
|
|
out := new(GetClientCredentialResponse)
|
|
err := c.cc.Invoke(ctx, "/lab.weixin.mp.auth.AuthService/GetClientCredential", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// AuthServiceServer is the server API for AuthService service.
|
|
// All implementations must embed UnimplementedAuthServiceServer
|
|
// for forward compatibility
|
|
type AuthServiceServer interface {
|
|
GetCodeURL(context.Context, *GetCodeURLRequest) (*GetCodeURLResponse, error)
|
|
ExchangeToken(context.Context, *ExchangeTokenRequest) (*ExchangeTokenResponse, error)
|
|
RefreshToken(context.Context, *RefreshTokenRequest) (*RefreshTokenResponse, error)
|
|
GetUserinfo(context.Context, *GetUserinfoRequest) (*GetUserinfoResponse, error)
|
|
// synchronize userinfo when its updated
|
|
SyncUserinfo(context.Context, *SyncUserinfoRequest) (*SyncUserinfoResponse, error)
|
|
GetClientCredential(context.Context, *emptypb.Empty) (*GetClientCredentialResponse, error)
|
|
mustEmbedUnimplementedAuthServiceServer()
|
|
}
|
|
|
|
// UnimplementedAuthServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedAuthServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedAuthServiceServer) GetCodeURL(context.Context, *GetCodeURLRequest) (*GetCodeURLResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetCodeURL not implemented")
|
|
}
|
|
func (UnimplementedAuthServiceServer) ExchangeToken(context.Context, *ExchangeTokenRequest) (*ExchangeTokenResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ExchangeToken not implemented")
|
|
}
|
|
func (UnimplementedAuthServiceServer) RefreshToken(context.Context, *RefreshTokenRequest) (*RefreshTokenResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method RefreshToken not implemented")
|
|
}
|
|
func (UnimplementedAuthServiceServer) GetUserinfo(context.Context, *GetUserinfoRequest) (*GetUserinfoResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetUserinfo not implemented")
|
|
}
|
|
func (UnimplementedAuthServiceServer) SyncUserinfo(context.Context, *SyncUserinfoRequest) (*SyncUserinfoResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method SyncUserinfo not implemented")
|
|
}
|
|
func (UnimplementedAuthServiceServer) GetClientCredential(context.Context, *emptypb.Empty) (*GetClientCredentialResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetClientCredential not implemented")
|
|
}
|
|
func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {}
|
|
|
|
// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to AuthServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeAuthServiceServer interface {
|
|
mustEmbedUnimplementedAuthServiceServer()
|
|
}
|
|
|
|
func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) {
|
|
s.RegisterService(&_AuthService_serviceDesc, srv)
|
|
}
|
|
|
|
func _AuthService_GetCodeURL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetCodeURLRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthServiceServer).GetCodeURL(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/lab.weixin.mp.auth.AuthService/GetCodeURL",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthServiceServer).GetCodeURL(ctx, req.(*GetCodeURLRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AuthService_ExchangeToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ExchangeTokenRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthServiceServer).ExchangeToken(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/lab.weixin.mp.auth.AuthService/ExchangeToken",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthServiceServer).ExchangeToken(ctx, req.(*ExchangeTokenRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AuthService_RefreshToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(RefreshTokenRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthServiceServer).RefreshToken(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/lab.weixin.mp.auth.AuthService/RefreshToken",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthServiceServer).RefreshToken(ctx, req.(*RefreshTokenRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AuthService_GetUserinfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetUserinfoRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthServiceServer).GetUserinfo(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/lab.weixin.mp.auth.AuthService/GetUserinfo",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthServiceServer).GetUserinfo(ctx, req.(*GetUserinfoRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AuthService_SyncUserinfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SyncUserinfoRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthServiceServer).SyncUserinfo(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/lab.weixin.mp.auth.AuthService/SyncUserinfo",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthServiceServer).SyncUserinfo(ctx, req.(*SyncUserinfoRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _AuthService_GetClientCredential_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(emptypb.Empty)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(AuthServiceServer).GetClientCredential(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/lab.weixin.mp.auth.AuthService/GetClientCredential",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(AuthServiceServer).GetClientCredential(ctx, req.(*emptypb.Empty))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _AuthService_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "lab.weixin.mp.auth.AuthService",
|
|
HandlerType: (*AuthServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "GetCodeURL",
|
|
Handler: _AuthService_GetCodeURL_Handler,
|
|
},
|
|
{
|
|
MethodName: "ExchangeToken",
|
|
Handler: _AuthService_ExchangeToken_Handler,
|
|
},
|
|
{
|
|
MethodName: "RefreshToken",
|
|
Handler: _AuthService_RefreshToken_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetUserinfo",
|
|
Handler: _AuthService_GetUserinfo_Handler,
|
|
},
|
|
{
|
|
MethodName: "SyncUserinfo",
|
|
Handler: _AuthService_SyncUserinfo_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetClientCredential",
|
|
Handler: _AuthService_GetClientCredential_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "clientapi/mp/auth/auth.proto",
|
|
}
|