Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
File 管理一个可原子写回的认证状态文件
func (*File) Account ¶
func (f *File) Account(globalProxy string) LoadedAccount
Account 返回协议客户端使用的账号来源
func (*File) SaveCookies ¶
SaveCookies 更新 Cookie 并原子写回认证状态
type ImportSource ¶
type ImportSource struct {
Browser string `json:"browser,omitempty"`
Profile string `json:"profile,omitempty"`
}
ImportSource 记录认证状态的浏览器来源
type LoadedAccount ¶
type LoadedAccount struct {
ID string
ProxyURL string
Source gemini.AccountSource
OAuth *OAuthMaterial
}
LoadedAccount 是服务启动使用的账号配置
type Metadata ¶
type Metadata struct {
ID string `json:"id"`
Proxy string `json:"proxy,omitempty"`
Source ImportSource `json:"source,omitempty"`
Language string `json:"language,omitempty"`
OAuth *OAuthMaterial `json:"oauth,omitempty"`
}
Metadata 保存账号固定身份
type OAuthMaterial ¶
type OAuthMaterial struct {
GaiaID string `json:"gaiaId"`
RefreshToken string `json:"refreshToken"`
WrappedBindingKey []byte `json:"wrappedBindingKey"`
}
OAuthMaterial 保存无需再次读取浏览器的续签材料
type StateCookie ¶
type StateCookie struct {
Name string `json:"name"`
Value string `json:"value"`
Domain string `json:"domain"`
Path string `json:"path"`
Expires float64 `json:"expires"`
HTTPOnly bool `json:"httpOnly"`
Secure bool `json:"secure"`
SameSite string `json:"sameSite,omitempty"`
}
StateCookie 表示 Playwright storage-state 中的 Cookie
type StorageState ¶
type StorageState struct {
Cookies []StateCookie `json:"cookies"`
Origins []json.RawMessage `json:"origins"`
Metadata Metadata `json:"geminiWeb2api"`
}
StorageState 是兼容 Playwright 的认证状态文件