github

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExchangeCode

func ExchangeCode(ctx context.Context, app Application, code string) (*githubv1.ExchangeResponse, error)

func Resolve

func Resolve(ctx context.Context, accessToken string) (*githubv1.Account, error)

Types

type Application

type Application struct {
	ClientID     string
	ClientSecret string
}

func ApplicationFromString

func ApplicationFromString(s string) (Application, error)

type RawExchangeRequest

type RawExchangeRequest struct {
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	Code         string `json:"code"`
}

type RawExchangeResponse

type RawExchangeResponse struct {
	Status                int
	Error                 string `json:"error"`
	AccessToken           string `json:"access_token"`
	ExpiresIn             int    `json:"expires_in"`
	RefreshToken          string `json:"refresh_token"`
	RefreshTokenExpiresIn int    `json:"refresh_token_expires_in"`
	TokenType             string `json:"token_type"`
	Scope                 string `json:"scope"`
}

func (*RawExchangeResponse) ToProto

type RawResolveResponse

type RawResolveResponse struct {
	Login             string `json:"login"`
	ID                uint32 `json:"id"`
	NodeID            string `json:"node_id"`
	AvatarURL         string `json:"avatar_url"`
	GravatarID        string `json:"gravatar_id"`
	URL               string `json:"url"`
	HTMLURL           string `json:"html_url"`
	FollowersURL      string `json:"followers_url"`
	FollowingURL      string `json:"following_url"`
	GistsURL          string `json:"gists_url"`
	StarredURL        string `json:"starred_url"`
	SubscriptionsURL  string `json:"subscriptions_url"`
	OrganizationsURL  string `json:"organizations_url"`
	ReposURL          string `json:"repos_url"`
	EventsURL         string `json:"events_url"`
	ReceivedEventsURL string `json:"received_events_url"`
	Type              string `json:"type"`
	UserViewType      string `json:"user_view_type"`
	SiteAdmin         bool   `json:"site_admin"`
	Name              string `json:"name"`
	Blog              string `json:"blog"`
	Email             string `json:"email"`
	NotificationEmail string `json:"notification_email"`
	PublicRepos       uint32 `json:"public_repos"`
	PublicGists       uint32 `json:"public_gists"`
	Followers         uint32 `json:"followers"`
	Following         uint32 `json:"following"`
	CreatedAt         string `json:"created_at"`
	UpdatedAt         string `json:"updated_at"`
}

func (*RawResolveResponse) ToProto

func (r *RawResolveResponse) ToProto() (*githubv1.Account, error)

Jump to

Keyboard shortcuts

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