Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cobra.Command{ Use: "cookiecloud", Aliases: []string{"cc"}, Short: "Use cookiecloud to sync site cookies or import sites.", Long: `Use cookiecloud to sync site cookies or import sites. To use this feature, add the cookiecloud servers to config file, e.g. : ptool.toml ---------- [[cookieclouds]] server = 'https://cookiecloud.example.com' uuid = 'uuid' password = 'password' ---------- See also: * CookieCloud: https://github.com/easychen/CookieCloud`, Args: cobra.MatchAll(cobra.ExactArgs(0), cobra.OnlyValidArgs), }
Functions ¶
func ParseProfile ¶
func ParseProfile(profile string) []*config.CookiecloudConfigStruct
Types ¶
type Ccdata_struct ¶
type Ccdata_struct struct {
Label string
Sites []string
Data *CookiecloudData
}
type CookieCloudBody ¶
type CookiecloudData ¶
type CookiecloudData struct {
// host => [{name,value,domain}...]
Cookie_data map[string][]map[string]any `json:"cookie_data"`
}
func GetCookiecloudData ¶
func GetCookiecloudData(server string, uuid string, password string, proxy string, timeout int64) (*CookiecloudData, error)
If proxy is empty, will try to get proxy from HTTP_PROXY & HTTPS_PROXY envs.
func (*CookiecloudData) GetEffectiveCookie ¶
func (cookiecloudData *CookiecloudData) GetEffectiveCookie(urlOrDomain string, all bool, format string) ( string, []*Cookie, error)
If all is false, only return cookies which is valid for both the hostname and path part of the urlOrDomain, in the case of urlOrDomain being a domain, it's path is assumed to be "/". If all is true, path check is skipped and all cookies which domain match will be included. format: "http" - http request "Cookie" header; "js" - JavaScript document.cookie="" code snippet
Click to show internal directories.
Click to hide internal directories.