Documentation
¶
Index ¶
- Variables
- func JobIDFromRepoID(repoID int64) string
- func LoadRepositoriesFromProviderSpace(ctx context.Context, provider Provider, spaceSlug string) ([]RepositoryInfo, Provider, error)
- func LoadRepositoryFromProvider(ctx context.Context, provider Provider, repoSlug string) (RepositoryInfo, Provider, error)
- func RepoIDFromJobID(jobID string) int64
- type Input
- type PipelineOption
- type Provider
- type ProviderType
- type Repository
- func (r *Repository) Cancel(ctx context.Context, repo *types.Repository) error
- func (r *Repository) GetProgress(ctx context.Context, repo *types.Repository) (job.Progress, error)
- func (r *Repository) Handle(ctx context.Context, data string, _ job.ProgressReporter) (string, error)
- func (r *Repository) Register(executor *job.Executor) error
- func (r *Repository) Run(ctx context.Context, provider Provider, repo *types.Repository, public bool, ...) error
- func (r *Repository) RunMany(ctx context.Context, groupID string, provider Provider, repoIDs []int64, ...) error
- type RepositoryInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is returned if no import data was found. ErrNotFound = errors.New("import not found") )
View Source
var WireSet = wire.NewSet( ProvideRepoImporter, )
Functions ¶
func JobIDFromRepoID ¶
func RepoIDFromJobID ¶
Types ¶
type PipelineOption ¶
type PipelineOption string
PipelineOption defines the supported pipeline import options for repository import.
const ( PipelineOptionConvert PipelineOption = "convert" PipelineOptionIgnore PipelineOption = "ignore" )
func (PipelineOption) Enum ¶
func (PipelineOption) Enum() []any
type Provider ¶
type Provider struct {
Type ProviderType `json:"type"`
Host string `json:"host"`
Username string `json:"username"`
Password string `json:"password"`
}
type ProviderType ¶
type ProviderType string
const ( ProviderTypeGitHub ProviderType = "github" ProviderTypeGitLab ProviderType = "gitlab" ProviderTypeBitbucket ProviderType = "bitbucket" ProviderTypeStash ProviderType = "stash" ProviderTypeGitea ProviderType = "gitea" ProviderTypeGogs ProviderType = "gogs" ProviderTypeAzure ProviderType = "azure" )
func (ProviderType) Enum ¶
func (p ProviderType) Enum() []any
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func ProvideRepoImporter ¶
func ProvideRepoImporter( config *types.Config, urlProvider url.Provider, git git.Interface, tx dbtx.Transactor, repoStore store.RepoStore, pipelineStore store.PipelineStore, triggerStore store.TriggerStore, encrypter encrypt.Encrypter, scheduler *job.Scheduler, executor *job.Executor, sseStreamer sse.Streamer, indexer keywordsearch.Indexer, publicAccess publicaccess.Service, auditService audit.Service, ) (*Repository, error)
func (*Repository) Cancel ¶
func (r *Repository) Cancel(ctx context.Context, repo *types.Repository) error
func (*Repository) GetProgress ¶
func (r *Repository) GetProgress(ctx context.Context, repo *types.Repository) (job.Progress, error)
func (*Repository) Handle ¶
func (r *Repository) Handle(ctx context.Context, data string, _ job.ProgressReporter) (string, error)
Handle is repository import background job handler.
func (*Repository) Run ¶
func (r *Repository) Run( ctx context.Context, provider Provider, repo *types.Repository, public bool, cloneURL string, pipelines PipelineOption, mirror bool, ) error
Run starts a background job that imports the provided repository from the provided clone URL.
func (*Repository) RunMany ¶
func (r *Repository) RunMany(ctx context.Context, groupID string, provider Provider, repoIDs []int64, publics []bool, cloneURLs []string, pipelines PipelineOption, mirror bool, ) error
RunMany starts background jobs that import the provided repositories from the provided clone URLs.
type RepositoryInfo ¶
type RepositoryInfo struct {
Space string
Identifier string
CloneURL string
IsPublic bool
DefaultBranch string
}
func (*RepositoryInfo) ToRepo ¶
func (r *RepositoryInfo) ToRepo( spaceID int64, spacePath string, identifier string, description string, principal *types.Principal, ) (*types.Repository, bool)
ToRepo converts the RepositoryInfo into the types.Repository object marked as being imported and is-public flag.
Click to show internal directories.
Click to hide internal directories.