sitesync

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2026 License: AGPL-3.0 Imports: 27 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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 ArchiveSite

func ArchiveSite(ctx context.Context, siteID int) error

func CheckinAccount

func CheckinAccount(ctx context.Context, accountID int) (*model.SiteCheckinResult, error)

func CheckinAll

func CheckinAll(ctx context.Context)

func CloudflareRetryAfter

func CloudflareRetryAfter(err error) time.Duration

func CreateAccountToken

func CreateAccountToken(ctx context.Context, accountID int, req model.SiteChannelKeyCreateRequest) (*model.SiteSyncResult, error)

func DeleteSite

func DeleteSite(ctx context.Context, siteID int) error

func DeleteSiteAccount

func DeleteSiteAccount(ctx context.Context, accountID int) error

func DetectPlatform

func DetectPlatform(ctx context.Context, rawURL string) (model.SitePlatform, error)

func IsCloudflareProtectionError

func IsCloudflareProtectionError(err error) bool

func ListArchivedSites

func ListArchivedSites(ctx context.Context) ([]model.Site, error)

func ProjectAccount

func ProjectAccount(ctx context.Context, accountID int) ([]int, error)

func ProjectSite

func ProjectSite(ctx context.Context, siteID int) error

func RefreshAccountRandomCheckinSchedule

func RefreshAccountRandomCheckinSchedule(ctx context.Context, accountID int) error

func RestoreSite

func RestoreSite(ctx context.Context, siteID int) error

func SyncAccount

func SyncAccount(ctx context.Context, accountID int) (*model.SiteSyncResult, error)

func SyncAll

func SyncAll(ctx context.Context)

Types

type CloudflareProtectionError

type CloudflareProtectionError struct {
	StatusCode int
	RetryAfter time.Duration
	Message    string
}

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"
	SiteBatchReasonUnauthorized            SiteBatchReason = "unauthorized"
	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"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL