Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ListOptions ¶
ListOptions common pagination options.
type Organization ¶
Organization represents an organization or group from any Git platform.
type Provider ¶
type Provider interface {
// Name returns the provider name (github, gitlab, gitea)
Name() string
// ListOrganizationRepos lists all repositories in an organization/group
ListOrganizationRepos(ctx context.Context, org string) ([]*Repository, error)
// ListUserRepos lists all repositories for a user
ListUserRepos(ctx context.Context, user string) ([]*Repository, error)
// GetRepository gets a single repository
GetRepository(ctx context.Context, owner, repo string) (*Repository, error)
// ListOrganizations lists organizations the authenticated user belongs to
ListOrganizations(ctx context.Context) ([]*Organization, error)
// GetRateLimit returns current rate limit status
GetRateLimit(ctx context.Context) (*RateLimit, error)
}
Provider defines the interface for Git platform providers.
type ProviderWithAuth ¶
type ProviderWithAuth interface {
Provider
// SetToken sets the authentication token
SetToken(token string) error
// ValidateToken validates the current token
ValidateToken(ctx context.Context) (bool, error)
}
ProviderWithAuth extends Provider with authentication capabilities.
type Repository ¶
type Repository struct {
Name string
FullName string
CloneURL string
SSHURL string
HTMLURL string
Description string
DefaultBranch string
Private bool
Archived bool
Fork bool
Disabled bool
Language string
Size int
Topics []string
Visibility string
CreatedAt time.Time
UpdatedAt time.Time
PushedAt time.Time
}
Repository represents a repository from any Git platform.
type SyncAction ¶
type SyncAction string
SyncAction represents what action was taken during sync.
const ( ActionCloned SyncAction = "cloned" ActionUpdated SyncAction = "updated" ActionSkipped SyncAction = "skipped" ActionFailed SyncAction = "failed" )
type SyncOptions ¶
type SyncOptions struct {
TargetPath string
Parallel int
IncludeArchived bool
IncludeForks bool
IncludePrivate bool
DryRun bool
}
SyncOptions configures repository synchronization.
type SyncResult ¶
type SyncResult struct {
Repository *Repository
Action SyncAction
Error error
}
SyncResult represents the result of syncing a single repository.
type Syncer ¶
type Syncer interface {
// SyncOrganization syncs all repositories from an organization
SyncOrganization(ctx context.Context, provider Provider, org string, opts SyncOptions) ([]SyncResult, error)
}
Syncer handles repository synchronization operations.
Click to show internal directories.
Click to hide internal directories.