ghauth

package
v0.158.4 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteToken

func DeleteToken() error

DeleteToken removes the GitHub OAuth token from the system keyring.

func GetToken

func GetToken() (*oauth2.Token, error)

GetToken retrieves the GitHub OAuth token from the system keyring.

func PollForToken

func PollForToken(ctx context.Context, clientID, clientSecret, deviceCode string, interval int, onAttempt func(attempt int)) (*oauth2.Token, error)

PollForToken polls GitHub for an access token.

func SaveToken

func SaveToken(token *oauth2.Token) error

SaveToken stores the GitHub OAuth token in the system keyring.

Types

type DeviceCodeResponse

type DeviceCodeResponse struct {
	DeviceCode      string `json:"device_code"`
	UserCode        string `json:"user_code"`
	VerificationURI string `json:"verification_uri"`
	ExpiresIn       int    `json:"expires_in"`
	Interval        int    `json:"interval"`
}

DeviceCodeResponse represents the response from GitHub's device code request.

func RequestDeviceCode

func RequestDeviceCode(ctx context.Context, clientID string) (*DeviceCodeResponse, error)

RequestDeviceCode requests a device code from GitHub.

Jump to

Keyboard shortcuts

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