copilot

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SignupURL = "https://github.com/github-copilot/signup?editor=crush"
	FreeURL   = "https://docs.github.com/en/copilot/how-tos/manage-your-account/get-free-access-to-copilot-pro"
)

Variables

View Source
var ErrNotAvailable = errors.New("github copilot not available")

Functions

func Headers

func Headers() map[string]string

func PollForToken

func PollForToken(ctx context.Context, dc *DeviceCode) (*oauth.Token, error)

PollForToken polls GitHub for the access token after user authorization.

func RefreshToken

func RefreshToken(ctx context.Context, githubToken string) (*oauth.Token, error)

RefreshToken refreshes the Copilot token using the GitHub token.

func RefreshTokenFromDisk

func RefreshTokenFromDisk() (string, bool)

Types

type DeviceCode

type DeviceCode 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"`
}

func RequestDeviceCode

func RequestDeviceCode(ctx context.Context) (*DeviceCode, error)

RequestDeviceCode initiates the device code flow with GitHub.

Jump to

Keyboard shortcuts

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