provider

package
v0.0.0-...-3a8f516 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListOptions

type ListOptions struct {
	Page    int
	PerPage int
}

ListOptions common pagination options.

type Organization

type Organization struct {
	Name        string
	Description string
	URL         string
}

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 RateLimit

type RateLimit struct {
	Limit     int
	Remaining int
	Reset     time.Time
	Used      int
}

RateLimit represents API rate limit information.

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.

Jump to

Keyboard shortcuts

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