Documentation
¶
Index ¶
- func AccountID(email string) string
- func DefaultChromeRoot() (string, error)
- func Refresh(ctx context.Context, material auth.OAuthMaterial, proxy string) ([]gemini.Cookie, error)
- func RemoteOrigin(raw string) (string, error)
- func RunSetup(ctx context.Context, args []string, stdin io.Reader, stdout io.Writer, ...) error
- func ValidateProxy(value string) (string, error)
- type Account
- type CookieImportOptions
- type ImportOptions
- type ImportResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultChromeRoot ¶ added in v0.1.3
DefaultChromeRoot 返回本机 Chrome User Data 目录
func Refresh ¶
func Refresh(ctx context.Context, material auth.OAuthMaterial, proxy string) ([]gemini.Cookie, error)
Refresh 使用已保存的设备绑定材料重新签发 Google Cookie
func RemoteOrigin ¶ added in v0.1.3
RemoteOrigin 校验远程实例地址只含协议与主机,非本机地址必须使用 HTTPS
func RunSetup ¶
func RunSetup(ctx context.Context, args []string, stdin io.Reader, stdout io.Writer, stderr io.Writer, interactive bool) error
RunSetup 执行首次账号配置
func ValidateProxy ¶ added in v0.1.3
ValidateProxy 校验 HTTP、HTTPS 或 SOCKS5 代理 URL 并返回去掉空白的值
Types ¶
type Account ¶
type Account struct {
Profile string `json:"profile"`
DisplayName string `json:"displayName"`
Email string `json:"email"`
Importable bool `json:"importable"`
}
Account 描述本机 Chrome 中可发现的 Google 账号
type CookieImportOptions ¶
CookieImportOptions 保存 Cookie 导入参数,Cookies 为 Cookie Header、浏览器导出的 JSON 或 Netscape cookies.txt
type ImportOptions ¶
type ImportOptions struct {
ChromeRoot string
Output string
Proxy string
Profiles []string
Emails []string
}
ImportOptions 保存批量导入参数
type ImportResult ¶
type ImportResult struct {
Profile string `json:"profile"`
Email string `json:"email"`
Imported bool `json:"imported"`
CookieCount int `json:"cookieCount"`
Path string `json:"path"`
CompletedAt string `json:"completedAt"`
}
ImportResult 描述单个账号导入结果
func Import ¶
func Import(ctx context.Context, options ImportOptions) ([]ImportResult, int, error)
Import 通过设备绑定 OAuth 认证材料生成协议账号状态
func ImportCookies ¶ added in v0.1.3
func ImportCookies(ctx context.Context, options CookieImportOptions) (ImportResult, int, error)
ImportCookies 从 Cookie 文本生成短期账号状态