Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterGithubOAuthServiceServer(s grpc.ServiceRegistrar, srv GithubOAuthServiceServer)
- type GetAccessTokenRequest
- func (*GetAccessTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetAccessTokenRequest) GetCode() string
- func (*GetAccessTokenRequest) ProtoMessage()
- func (x *GetAccessTokenRequest) ProtoReflect() protoreflect.Message
- func (x *GetAccessTokenRequest) Reset()
- func (x *GetAccessTokenRequest) String() string
- type GetAccessTokenResponse
- func (*GetAccessTokenResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetAccessTokenResponse) GetAccessToken() string
- func (x *GetAccessTokenResponse) GetError() string
- func (*GetAccessTokenResponse) ProtoMessage()
- func (x *GetAccessTokenResponse) ProtoReflect() protoreflect.Message
- func (x *GetAccessTokenResponse) Reset()
- func (x *GetAccessTokenResponse) String() string
- type GetUserInfoRequest
- func (*GetUserInfoRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserInfoRequest) GetAccessToken() string
- func (*GetUserInfoRequest) ProtoMessage()
- func (x *GetUserInfoRequest) ProtoReflect() protoreflect.Message
- func (x *GetUserInfoRequest) Reset()
- func (x *GetUserInfoRequest) String() string
- type GetUserInfoResponse
- func (*GetUserInfoResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserInfoResponse) GetError() string
- func (x *GetUserInfoResponse) GetUserInfo() *UserInfo
- func (*GetUserInfoResponse) ProtoMessage()
- func (x *GetUserInfoResponse) ProtoReflect() protoreflect.Message
- func (x *GetUserInfoResponse) Reset()
- func (x *GetUserInfoResponse) String() string
- type GithubOAuthServiceClient
- type GithubOAuthServiceServer
- type UnimplementedGithubOAuthServiceServer
- type UnsafeGithubOAuthServiceServer
- type UserInfo
- func (*UserInfo) Descriptor() ([]byte, []int)deprecated
- func (x *UserInfo) GetAvatarUrl() string
- func (x *UserInfo) GetEmail() string
- func (x *UserInfo) GetLogin() string
- func (x *UserInfo) GetName() string
- func (*UserInfo) ProtoMessage()
- func (x *UserInfo) ProtoReflect() protoreflect.Message
- func (x *UserInfo) Reset()
- func (x *UserInfo) String() string
Constants ¶
const ( GithubOAuthService_GetAccessToken_FullMethodName = "/githuboauth.GithubOAuthService/GetAccessToken" GithubOAuthService_GetUserInfo_FullMethodName = "/githuboauth.GithubOAuthService/GetUserInfo" )
Variables ¶
var File_github_oauth_proto protoreflect.FileDescriptor
var GithubOAuthService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "githuboauth.GithubOAuthService", HandlerType: (*GithubOAuthServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetAccessToken", Handler: _GithubOAuthService_GetAccessToken_Handler, }, { MethodName: "GetUserInfo", Handler: _GithubOAuthService_GetUserInfo_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "github_oauth.proto", }
GithubOAuthService_ServiceDesc is the grpc.ServiceDesc for GithubOAuthService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterGithubOAuthServiceServer ¶
func RegisterGithubOAuthServiceServer(s grpc.ServiceRegistrar, srv GithubOAuthServiceServer)
Types ¶
type GetAccessTokenRequest ¶
type GetAccessTokenRequest struct {
Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` // GitHub返回的授权码
// contains filtered or unexported fields
}
获取GitHub访问令牌的请求/响应
func (*GetAccessTokenRequest) Descriptor
deprecated
func (*GetAccessTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetAccessTokenRequest.ProtoReflect.Descriptor instead.
func (*GetAccessTokenRequest) GetCode ¶
func (x *GetAccessTokenRequest) GetCode() string
func (*GetAccessTokenRequest) ProtoMessage ¶
func (*GetAccessTokenRequest) ProtoMessage()
func (*GetAccessTokenRequest) ProtoReflect ¶
func (x *GetAccessTokenRequest) ProtoReflect() protoreflect.Message
func (*GetAccessTokenRequest) Reset ¶
func (x *GetAccessTokenRequest) Reset()
func (*GetAccessTokenRequest) String ¶
func (x *GetAccessTokenRequest) String() string
type GetAccessTokenResponse ¶
type GetAccessTokenResponse struct {
AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` // 生成的访问令牌
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` // 错误信息
// contains filtered or unexported fields
}
func (*GetAccessTokenResponse) Descriptor
deprecated
func (*GetAccessTokenResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetAccessTokenResponse.ProtoReflect.Descriptor instead.
func (*GetAccessTokenResponse) GetAccessToken ¶
func (x *GetAccessTokenResponse) GetAccessToken() string
func (*GetAccessTokenResponse) GetError ¶
func (x *GetAccessTokenResponse) GetError() string
func (*GetAccessTokenResponse) ProtoMessage ¶
func (*GetAccessTokenResponse) ProtoMessage()
func (*GetAccessTokenResponse) ProtoReflect ¶
func (x *GetAccessTokenResponse) ProtoReflect() protoreflect.Message
func (*GetAccessTokenResponse) Reset ¶
func (x *GetAccessTokenResponse) Reset()
func (*GetAccessTokenResponse) String ¶
func (x *GetAccessTokenResponse) String() string
type GetUserInfoRequest ¶
type GetUserInfoRequest struct {
AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` // 访问令牌
// contains filtered or unexported fields
}
获取GitHub用户信息的请求/响应
func (*GetUserInfoRequest) Descriptor
deprecated
func (*GetUserInfoRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetUserInfoRequest.ProtoReflect.Descriptor instead.
func (*GetUserInfoRequest) GetAccessToken ¶
func (x *GetUserInfoRequest) GetAccessToken() string
func (*GetUserInfoRequest) ProtoMessage ¶
func (*GetUserInfoRequest) ProtoMessage()
func (*GetUserInfoRequest) ProtoReflect ¶
func (x *GetUserInfoRequest) ProtoReflect() protoreflect.Message
func (*GetUserInfoRequest) Reset ¶
func (x *GetUserInfoRequest) Reset()
func (*GetUserInfoRequest) String ¶
func (x *GetUserInfoRequest) String() string
type GetUserInfoResponse ¶
type GetUserInfoResponse struct {
UserInfo *UserInfo `protobuf:"bytes,1,opt,name=user_info,json=userInfo,proto3" json:"user_info,omitempty"` // 用户信息
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` // 错误信息
// contains filtered or unexported fields
}
func (*GetUserInfoResponse) Descriptor
deprecated
func (*GetUserInfoResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetUserInfoResponse.ProtoReflect.Descriptor instead.
func (*GetUserInfoResponse) GetError ¶
func (x *GetUserInfoResponse) GetError() string
func (*GetUserInfoResponse) GetUserInfo ¶
func (x *GetUserInfoResponse) GetUserInfo() *UserInfo
func (*GetUserInfoResponse) ProtoMessage ¶
func (*GetUserInfoResponse) ProtoMessage()
func (*GetUserInfoResponse) ProtoReflect ¶
func (x *GetUserInfoResponse) ProtoReflect() protoreflect.Message
func (*GetUserInfoResponse) Reset ¶
func (x *GetUserInfoResponse) Reset()
func (*GetUserInfoResponse) String ¶
func (x *GetUserInfoResponse) String() string
type GithubOAuthServiceClient ¶
type GithubOAuthServiceClient interface {
GetAccessToken(ctx context.Context, in *GetAccessTokenRequest, opts ...grpc.CallOption) (*GetAccessTokenResponse, error)
GetUserInfo(ctx context.Context, in *GetUserInfoRequest, opts ...grpc.CallOption) (*GetUserInfoResponse, error)
}
GithubOAuthServiceClient is the client API for GithubOAuthService 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.
GitHub OAuth服务
func NewGithubOAuthServiceClient ¶
func NewGithubOAuthServiceClient(cc grpc.ClientConnInterface) GithubOAuthServiceClient
type GithubOAuthServiceServer ¶
type GithubOAuthServiceServer interface {
GetAccessToken(context.Context, *GetAccessTokenRequest) (*GetAccessTokenResponse, error)
GetUserInfo(context.Context, *GetUserInfoRequest) (*GetUserInfoResponse, error)
// contains filtered or unexported methods
}
GithubOAuthServiceServer is the server API for GithubOAuthService service. All implementations must embed UnimplementedGithubOAuthServiceServer for forward compatibility.
GitHub OAuth服务
type UnimplementedGithubOAuthServiceServer ¶
type UnimplementedGithubOAuthServiceServer struct{}
UnimplementedGithubOAuthServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedGithubOAuthServiceServer) GetAccessToken ¶
func (UnimplementedGithubOAuthServiceServer) GetAccessToken(context.Context, *GetAccessTokenRequest) (*GetAccessTokenResponse, error)
func (UnimplementedGithubOAuthServiceServer) GetUserInfo ¶
func (UnimplementedGithubOAuthServiceServer) GetUserInfo(context.Context, *GetUserInfoRequest) (*GetUserInfoResponse, error)
type UnsafeGithubOAuthServiceServer ¶
type UnsafeGithubOAuthServiceServer interface {
// contains filtered or unexported methods
}
UnsafeGithubOAuthServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GithubOAuthServiceServer will result in compilation errors.
type UserInfo ¶
type UserInfo struct {
Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` // GitHub用户名(唯一标识)
AvatarUrl string `protobuf:"bytes,2,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` // 头像URL
Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` // 邮箱
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` // 姓名
// contains filtered or unexported fields
}
func (*UserInfo) Descriptor
deprecated
func (*UserInfo) GetAvatarUrl ¶
func (*UserInfo) ProtoMessage ¶
func (*UserInfo) ProtoMessage()
func (*UserInfo) ProtoReflect ¶
func (x *UserInfo) ProtoReflect() protoreflect.Message