Help us shape the future of Go! Take the 2026 Go Developer Survey

antigravity

package
v0.413.3 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GoogleClientID     = "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com"
	GoogleClientSecret = "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"
)

Variables

View Source
var (
	GoogleAuthorizeURL      = "https://accounts.google.com/o/oauth2/v2/auth"
	GoogleTokenURL          = "https://oauth2.googleapis.com/token"
	GoogleUserInfoURL       = "https://openidconnect.googleapis.com/v1/userinfo"
	AntigravityLoadURLProd  = "https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist"
	AntigravityLoadURLDaily = "https://daily-cloudcode-pa.sandbox.googleapis.com/v1internal:loadCodeAssist"
)
View Source
var DefaultScopes = []string{
	"openid",
	"email",
	"profile",
	"https://www.googleapis.com/auth/cloud-platform",
	"https://www.googleapis.com/auth/userinfo.email",
	"https://www.googleapis.com/auth/userinfo.profile",
	"https://www.googleapis.com/auth/cclog",
	"https://www.googleapis.com/auth/experimentsandconfigs",
}

Functions

func CodeChallenge

func CodeChallenge(verifier string) string

func FetchProjectID added in v0.413.3

func FetchProjectID(client *http.Client, accessToken string) (string, error)

Types

type Project

type Project struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	DisplayName string `json:"displayName"`
}

type Session

type Session struct {
	State        string `json:"state"`
	CodeVerifier string `json:"codeVerifier"`
	RedirectURI  string `json:"redirectUri"`
	ProjectID    string `json:"projectId,omitempty"`
}

func NewSession

func NewSession(redirectURI string) (*Session, error)

func (Session) AuthURL

func (s Session) AuthURL() (string, error)

func (Session) ValidateCallback

func (s Session) ValidateCallback(state string) error

type Token

type Token struct {
	AccessToken  string   `json:"accessToken"`
	RefreshToken string   `json:"refreshToken,omitempty"`
	TokenType    string   `json:"tokenType,omitempty"`
	Expiry       int64    `json:"expiry,omitempty"`
	Scopes       []string `json:"scopes,omitempty"`
	IDToken      string   `json:"idToken,omitempty"`
	ProjectID    string   `json:"projectId,omitempty"`
}

func ExchangeCode

func ExchangeCode(client *http.Client, code, verifier, redirectURI string) (*Token, error)

func RefreshToken

func RefreshToken(client *http.Client, refreshToken string) (*Token, error)

type UserInfo

type UserInfo struct {
	Email         string `json:"email"`
	EmailVerified bool   `json:"email_verified"`
	Name          string `json:"name"`
	Picture       string `json:"picture"`
	Subject       string `json:"sub"`
}

func FetchUserInfo

func FetchUserInfo(client *http.Client, accessToken string) (*UserInfo, error)

Jump to

Keyboard shortcuts

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