github

package
v0.0.0-...-dae10ae Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const UriUser = "https://api.github.com/user"

Variables

View Source
var ServiceChanged = fmt.Errorf("github api seems to have changed")
View Source
var ServiceNotAvailable = fmt.Errorf("fails to fetch github access token")

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

func New

func New(config Config) Adapter

func (Adapter) CreateOAuthURI

func (g Adapter) CreateOAuthURI(state string) (string, error)

func (Adapter) FetchOAuthToken

func (g Adapter) FetchOAuthToken(code string) (identity.GithubOAuthToken, error)

func (Adapter) FetchUserPublicProfile

func (g Adapter) FetchUserPublicProfile(token string) (identity.GithubUserPublicProfile, error)

type Config

type Config struct {
	ClientID         string
	ClientSecret     string
	OAuthRedirectURI string
}

type GithubOAuthToken

type GithubOAuthToken struct {
	AccessToken string `json:"access_token"`
	Scope       string `json:"scope"`
	TokenType   string `json:"token_type"`
}

Jump to

Keyboard shortcuts

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