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 ExternalComment
- type ExternalPullRequest
- type Input
- type PipelineOption
- type Provider
- type ProviderType
- type PullReq
- 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, ProvidePullReqImporter, )
Functions ¶
func JobIDFromRepoID ¶
func RepoIDFromJobID ¶
Types ¶
type ExternalComment ¶
type ExternalComment = migratetypes.Comment
type ExternalPullRequest ¶
type ExternalPullRequest = migratetypes.PullRequestData
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 PullReq ¶
type PullReq struct {
// contains filtered or unexported fields
}
PullReq is pull request importer.
func ProvidePullReqImporter ¶
func ProvidePullReqImporter( urlProvider url.Provider, git git.Interface, principalStore store.PrincipalStore, repoStore store.RepoStore, pullReqStore store.PullReqStore, pullReqActStore store.PullReqActivityStore, tx dbtx.Transactor, ) *PullReq
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, ) error
Run starts a background job that imports the provided repository from the provided clone URL.
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.