copilot

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package copilot provides a client for GitHub Copilot's API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	Token     string `json:"token"`
	ExpiresAt int64  `json:"expires_at"`
	Endpoints struct {
		API           string `json:"api"` // Can change in Github Enterprise instances
		OriginTracker string `json:"origin-tracker"`
		Proxy         string `json:"proxy"`
		Telemetry     string `json:"telemetry"`
	} `json:"endpoints"`
	ErrorDetails *struct {
		URL            string `json:"url,omitempty"`
		Message        string `json:"message,omitempty"`
		Title          string `json:"title,omitempty"`
		NotificationID string `json:"notification_id,omitempty"`
	} `json:"error_details,omitempty"`
}

AccessToken response from GitHub Copilot's token endpoint.

type Client

type Client struct {
	AccessToken *AccessToken
	// contains filtered or unexported fields
}

Client copilot client.

func New

func New(cacheDir string) *Client

New new copilot client.

func (*Client) Auth

func (c *Client) Auth() (AccessToken, error)

Auth authenticates the user and retrieves an access token.

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

Do does the request.

Jump to

Keyboard shortcuts

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