githuboauth

package
v0.0.0-...-19a85bd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GithubOAuthService_GetAccessToken_FullMethodName = "/githuboauth.GithubOAuthService/GetAccessToken"
	GithubOAuthService_GetUserInfo_FullMethodName    = "/githuboauth.GithubOAuthService/GetUserInfo"
)

Variables

View Source
var File_github_oauth_proto protoreflect.FileDescriptor
View Source
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服务

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) GetUserInfo

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) Descriptor() ([]byte, []int)

Deprecated: Use UserInfo.ProtoReflect.Descriptor instead.

func (*UserInfo) GetAvatarUrl

func (x *UserInfo) GetAvatarUrl() string

func (*UserInfo) GetEmail

func (x *UserInfo) GetEmail() string

func (*UserInfo) GetLogin

func (x *UserInfo) GetLogin() string

func (*UserInfo) GetName

func (x *UserInfo) GetName() string

func (*UserInfo) ProtoMessage

func (*UserInfo) ProtoMessage()

func (*UserInfo) ProtoReflect

func (x *UserInfo) ProtoReflect() protoreflect.Message

func (*UserInfo) Reset

func (x *UserInfo) Reset()

func (*UserInfo) String

func (x *UserInfo) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL