Documentation
¶
Index ¶
- Constants
- func CheckCopilotModelsAPI(token, baseURL string) error
- func CopilotAPIBaseURL(enterpriseURL string) string
- func CopilotDeviceFlowInstructions(deviceCode CopilotDeviceCode) string
- func CopilotSessionFilePath() (string, error)
- func DeleteCopilotSession() error
- func LoadGitHubOAuthToken() (string, error)
- func NormalizeGitHubDomain(value string) string
- func OpenBrowser(url string) error
- func SaveCopilotSession(session CopilotSession) error
- func ValidateCopilotToken(ctx context.Context, session CopilotSession) error
- type CopilotAuthStatus
- type CopilotDeviceCode
- type CopilotSession
- func CompleteCopilotDeviceFlow(ctx context.Context, enterpriseURL string, deviceCode *CopilotDeviceCode) (*CopilotSession, error)
- func LoadCopilotSession() (*CopilotSession, error)
- func PollCopilotDeviceFlow(ctx context.Context, enterpriseURL string, deviceCode *CopilotDeviceCode) (*CopilotSession, error)
Constants ¶
View Source
const (
CopilotClientID = "Ov23li8tweQw6odWQebz"
)
Variables ¶
This section is empty.
Functions ¶
func CheckCopilotModelsAPI ¶
CheckCopilotModelsAPI verifies that the Copilot models API endpoint is reachable using the provided bearer token and base URL.
func CopilotAPIBaseURL ¶
func CopilotDeviceFlowInstructions ¶
func CopilotDeviceFlowInstructions(deviceCode CopilotDeviceCode) string
func CopilotSessionFilePath ¶
func DeleteCopilotSession ¶
func DeleteCopilotSession() error
func LoadGitHubOAuthToken ¶
func NormalizeGitHubDomain ¶
func OpenBrowser ¶
func SaveCopilotSession ¶
func SaveCopilotSession(session CopilotSession) error
func ValidateCopilotToken ¶
func ValidateCopilotToken(ctx context.Context, session CopilotSession) error
Types ¶
type CopilotAuthStatus ¶
type CopilotAuthStatus struct {
Authenticated bool
Source string
EnterpriseURL string
Message string
}
func GetCopilotAuthStatus ¶
func GetCopilotAuthStatus() CopilotAuthStatus
type CopilotDeviceCode ¶
type CopilotDeviceCode struct {
DeviceCode string `json:"device_code"`
UserCode string `json:"user_code"`
VerificationURI string `json:"verification_uri"`
Interval int `json:"interval"`
ExpiresIn int `json:"expires_in"`
}
func StartCopilotDeviceFlow ¶
func StartCopilotDeviceFlow(ctx context.Context, enterpriseURL string) (*CopilotDeviceCode, error)
type CopilotSession ¶
type CopilotSession struct {
Provider string `json:"provider,omitempty"`
AccessToken string `json:"access_token"`
TokenType string `json:"token_type,omitempty"`
Scope string `json:"scope,omitempty"`
ExpiresAt int64 `json:"expires_at,omitempty"`
EnterpriseURL string `json:"enterprise_url,omitempty"`
CreatedAt int64 `json:"created_at,omitempty"`
}
func CompleteCopilotDeviceFlow ¶
func CompleteCopilotDeviceFlow(ctx context.Context, enterpriseURL string, deviceCode *CopilotDeviceCode) (*CopilotSession, error)
func LoadCopilotSession ¶
func LoadCopilotSession() (*CopilotSession, error)
func PollCopilotDeviceFlow ¶
func PollCopilotDeviceFlow(ctx context.Context, enterpriseURL string, deviceCode *CopilotDeviceCode) (*CopilotSession, error)
Click to show internal directories.
Click to hide internal directories.