Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Unspecified ... NotificationTypeUnspecified = NotificationType("URL_NOTIFICATION_TYPE_UNSPECIFIED") // Updated means that The given URL (Web document) has been updated. NotificationTypeUpdated = NotificationType("URL_UPDATED") // Deleted means that The given URL (Web document) has been deleted. NotificationTypeDeleted = NotificationType("URL_DELETED") )
The URL life cycle event that Google is being notified about.
View Source
const (
PublishAPIDefaultQuota = 200
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient interface {
Publish(u string, nt NotificationType) (result *indexing.PublishUrlNotificationResponse, err error)
}
APIClient is interface of client to request Google Indexing API
func NewByWithToken ¶
type Client ¶
type Client struct {
Service *indexing.Service
}
Client is defined parameters to request Google Indexing API
type Config ¶
type Config struct { // Quota is Publish API requests limit per day Quota *int // Context is used to send Google indexing API request Context context.Context // CredentialsFile is Google APIs credentials file path. // You must set either CredentialsFile or Token. // If both are set, Token will be given priority. CredentialsFile *string // CredentialsFile is Google APIs credentials file path. // You must set either CredentialsFile or Token. // If both are set, Token will be given priority. Token oauth2.TokenSource // Crawler is the instance of the client accessing your web page Crawler *http.Client // Logger is logger instance Logger *zap.Logger // Logging is the flag if outputs logs Logging bool }
type NotificationType ¶
type NotificationType string
type PublishRequest ¶
type PublishRequest struct { URL string NotificationType NotificationType }
PublishRequest is defined indexing API request
type Publisher ¶
type Publisher interface { Precheck(input []PublishRequest) (requests []PublishRequest, skips []SkipedPublishRequest) Publish(request PublishRequest) (responses *indexing.PublishUrlNotificationResponse, skip bool, err error) }
Publisher ...
func MustPublish ¶
func PublishWithClient ¶
New creates new coordinator instance with API client
type SkipedPublishRequest ¶
type SkipedPublishRequest struct { URL string NotificationType NotificationType Reason error }
SkipedPublishRequest is defined skiped indexing API request
Click to show internal directories.
Click to hide internal directories.