Documentation
¶
Index ¶
- Constants
- func ArchiveSite(ctx context.Context, siteID int) error
- func CheckinAccount(ctx context.Context, accountID int) (*model.SiteCheckinResult, error)
- func CheckinAll(ctx context.Context)
- func CloudflareRetryAfter(err error) time.Duration
- func CreateAccountToken(ctx context.Context, accountID int, req model.SiteChannelKeyCreateRequest) (*model.SiteSyncResult, error)
- func DeleteSite(ctx context.Context, siteID int) error
- func DeleteSiteAccount(ctx context.Context, accountID int) error
- func DetectPlatform(ctx context.Context, rawURL string) (model.SitePlatform, error)
- func IsCloudflareProtectionError(err error) bool
- func ListArchivedSites(ctx context.Context) ([]model.Site, error)
- func ProjectAccount(ctx context.Context, accountID int) ([]int, error)
- func ProjectSite(ctx context.Context, siteID int) error
- func RefreshAccountRandomCheckinSchedule(ctx context.Context, accountID int) error
- func RestoreSite(ctx context.Context, siteID int) error
- func SyncAccount(ctx context.Context, accountID int) (*model.SiteSyncResult, error)
- func SyncAll(ctx context.Context)
- type CloudflareProtectionError
- type SiteBatchFailureSample
- type SiteBatchOptions
- type SiteBatchOutcomeGroup
- type SiteBatchPhase
- type SiteBatchReason
- type SiteBatchSummary
- type SiteBatchTrigger
Constants ¶
View Source
const ( CodeSiteSyncMissingGroupKey = "site.sync.missing_group_key" CodeSiteSyncGroupModelsUnresolved = "site.sync.group_models_unresolved" CodeSiteSyncNoGroupResult = "site.sync.no_group_result" CodeSiteSyncAllGroupsUnresolved = "site.sync.all_groups_unresolved" CodeSiteSyncUnsupportedPlatform = "site.sync.unsupported_platform" CodeSiteSyncSnapshotNil = "site.sync.snapshot_nil" CodeSiteAuthAccessTokenRequired = "site.auth.access_token_required" CodeSiteAuthDirectTokenRequired = "site.auth.direct_token_required" CodeSiteAuthLoginFailed = "site.auth.login_failed" CodeSiteAuthLoginTokenMissing = "site.auth.login_token_missing" CodeSiteUpstreamHTTPError = "site.upstream.http_error" CodeSiteUpstreamDecodeFailed = "site.upstream.decode_failed" CodeSiteUpstreamCloudflareChallenge = "site.upstream.cloudflare_challenge" )
Variables ¶
This section is empty.
Functions ¶
func CheckinAccount ¶
func CheckinAll ¶
func CloudflareRetryAfter ¶
func CreateAccountToken ¶
func CreateAccountToken(ctx context.Context, accountID int, req model.SiteChannelKeyCreateRequest) (*model.SiteSyncResult, error)
func DetectPlatform ¶
func SyncAccount ¶
Types ¶
type CloudflareProtectionError ¶
func (*CloudflareProtectionError) Error ¶
func (e *CloudflareProtectionError) Error() string
type SiteBatchFailureSample ¶
type SiteBatchFailureSample struct {
SiteID int
Platform model.SitePlatform
AccountID int
Reason SiteBatchReason
Message string
}
type SiteBatchOptions ¶
type SiteBatchOptions struct {
Trigger SiteBatchTrigger
}
type SiteBatchOutcomeGroup ¶
type SiteBatchOutcomeGroup struct {
SiteID int
Platform model.SitePlatform
Reason SiteBatchReason
Count int
Failed int
Skipped int
Warnings int
}
type SiteBatchPhase ¶
type SiteBatchPhase string
const ( SiteBatchPhaseSync SiteBatchPhase = "sync" SiteBatchPhaseCheckin SiteBatchPhase = "checkin" )
type SiteBatchReason ¶
type SiteBatchReason string
const ( SiteBatchReasonCloudflareProtection SiteBatchReason = "cloudflare_protection" SiteBatchReasonLoginFailed SiteBatchReason = "login_failed" SiteBatchReasonAccessTokenRequired SiteBatchReason = "access_token_required" SiteBatchReasonDirectTokenRequired SiteBatchReason = "direct_token_required" SiteBatchReasonUnsupportedPlatform SiteBatchReason = "unsupported_platform" SiteBatchReasonUnsupportedCheckin SiteBatchReason = "unsupported_checkin" SiteBatchReasonMissingGroupKey SiteBatchReason = "missing_group_key" SiteBatchReasonUpstreamHTTPError SiteBatchReason = "upstream_http_error" SiteBatchReasonUpstreamDecodeFailed SiteBatchReason = "upstream_decode_failed" SiteBatchReasonUpstreamHTMLResponse SiteBatchReason = "upstream_html_response" SiteBatchReasonScheduledLater SiteBatchReason = "scheduled_later" SiteBatchReasonBatchCanceled SiteBatchReason = "batch_canceled" SiteBatchReasonTimeout SiteBatchReason = "timeout" SiteBatchReasonContextCanceled SiteBatchReason = "context_canceled" SiteBatchReasonContextDeadlineExceeded SiteBatchReason = "context_deadline_exceeded" SiteBatchReasonDatabaseError SiteBatchReason = "database_error" SiteBatchReasonInternalError SiteBatchReason = "internal_error" SiteBatchReasonUnknown SiteBatchReason = "unknown" )
type SiteBatchSummary ¶
type SiteBatchSummary struct {
Phase SiteBatchPhase
Trigger SiteBatchTrigger
Total int
Attempted int
Success int
Partial int
Failed int
Skipped int
Warnings int
Canceled bool
CancelReason SiteBatchReason
Duration time.Duration
Samples []SiteBatchFailureSample
// contains filtered or unexported fields
}
func CheckinAllWithOptions ¶
func CheckinAllWithOptions(ctx context.Context, opts SiteBatchOptions) SiteBatchSummary
func SyncAccountsWithOptions ¶
func SyncAccountsWithOptions(ctx context.Context, accountIDs []int, opts SiteBatchOptions) SiteBatchSummary
func SyncAllWithOptions ¶
func SyncAllWithOptions(ctx context.Context, opts SiteBatchOptions) SiteBatchSummary
type SiteBatchTrigger ¶
type SiteBatchTrigger string
const ( SiteBatchTriggerScheduled SiteBatchTrigger = "scheduled" SiteBatchTriggerManual SiteBatchTrigger = "manual" SiteBatchTriggerImport SiteBatchTrigger = "import" SiteBatchTriggerAuto SiteBatchTrigger = "auto" )
Click to show internal directories.
Click to hide internal directories.