ghauth

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

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