Documentation
¶
Index ¶
- func GenerateSitemap(urls []string, filename string) error
- func GenerateSitemapIndex(sitemaps []string, filename string) error
- func PingSearchEngines(sitemapURL string) error
- func SplitSitemap(urls []string, maxURLsPerSitemap int, baseURL string) ([]string, error)
- type Client
- func (c *Client) BatchInspectURL(urls []string, ...)
- func (c *Client) BatchPublishURLs(urls []string, urlType string, ...)
- func (c *Client) GetSearchAnalytics(startDate, endDate string) (*searchconsole.SearchAnalyticsQueryResponse, error)
- func (c *Client) GetSites() ([]*searchconsole.WmxSite, error)
- func (c *Client) GetURLNotificationStatus(url string) (*indexing.UrlNotificationMetadata, error)
- func (c *Client) InspectURL(url string) (*URLInspectionResult, error)
- func (c *Client) PublishURL(url string, urlType string) error
- func (c *Client) SubmitSitemap(sitemapURL string) error
- type Config
- type Sitemap
- type SitemapIndex
- type SitemapRef
- type SitemapURL
- type URLInspectionRequest
- type URLInspectionResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSitemap ¶
GenerateSitemap 生成网站地图
func GenerateSitemapIndex ¶
GenerateSitemapIndex 生成网站地图索引
func PingSearchEngines ¶
PingSearchEngines 通知搜索引擎网站地图更新
Types ¶
type Client ¶
type Client struct {
SiteURL string
// contains filtered or unexported fields
}
Client Google Search Console API客户端
func (*Client) BatchInspectURL ¶
func (c *Client) BatchInspectURL(urls []string, callback func(url string, result *URLInspectionResult, err error))
BatchInspectURL 批量检查URL状态
func (*Client) BatchPublishURLs ¶
func (c *Client) BatchPublishURLs(urls []string, urlType string, callback func(url string, success bool, err error))
BatchPublishURLs 批量提交URL到Google索引
func (*Client) GetSearchAnalytics ¶
func (c *Client) GetSearchAnalytics(startDate, endDate string) (*searchconsole.SearchAnalyticsQueryResponse, error)
GetSearchAnalytics 获取搜索分析数据
func (*Client) GetSites ¶
func (c *Client) GetSites() ([]*searchconsole.WmxSite, error)
GetSites 获取已验证的网站列表
func (*Client) GetURLNotificationStatus ¶
func (c *Client) GetURLNotificationStatus(url string) (*indexing.UrlNotificationMetadata, error)
GetURLNotificationStatus 获取URL通知状态
func (*Client) InspectURL ¶
func (c *Client) InspectURL(url string) (*URLInspectionResult, error)
InspectURL 检查URL索引状态
func (*Client) PublishURL ¶
PublishURL 提交URL到Google索引
func (*Client) SubmitSitemap ¶
SubmitSitemap 提交网站地图
type Config ¶
type Config struct {
CredentialsFile string `json:"credentials_file"`
SiteURL string `json:"site_url"`
TokenFile string `json:"token_file"`
}
Config 配置信息
type Sitemap ¶
type Sitemap struct {
XMLName xml.Name `xml:"urlset"`
Xmlns string `xml:"xmlns,attr"`
URLs []SitemapURL `xml:"url"`
}
Sitemap 网站地图结构
type SitemapIndex ¶
type SitemapIndex struct {
XMLName xml.Name `xml:"sitemapindex"`
Xmlns string `xml:"xmlns,attr"`
Sitemaps []SitemapRef `xml:"sitemap"`
}
SitemapIndex 网站地图索引
type SitemapRef ¶
SitemapRef 网站地图引用
type SitemapURL ¶
type SitemapURL struct {
Loc string `xml:"loc"`
LastMod string `xml:"lastmod,omitempty"`
ChangeFreq string `xml:"changefreq,omitempty"`
Priority string `xml:"priority,omitempty"`
}
SitemapURL 网站地图URL项
type URLInspectionRequest ¶
type URLInspectionRequest struct {
InspectionURL string `json:"inspectionUrl"`
SiteURL string `json:"siteUrl"`
LanguageCode string `json:"languageCode"`
}
URLInspectionRequest URL检查请求
type URLInspectionResult ¶
type URLInspectionResult struct {
IndexStatusResult struct {
IndexingState string `json:"indexingState"`
LastCrawled string `json:"lastCrawled"`
CrawlErrors []struct {
ErrorCode string `json:"errorCode"`
} `json:"crawlErrors"`
} `json:"indexStatusResult"`
MobileUsabilityResult struct {
MobileFriendly bool `json:"mobileFriendly"`
} `json:"mobileUsabilityResult"`
RichResultsResult struct {
Detected struct {
Items []struct {
RichResultType string `json:"richResultType"`
} `json:"items"`
} `json:"detected"`
} `json:"richResultsResult"`
}
URLInspectionResult URL检查结果
Click to show internal directories.
Click to hide internal directories.