Documentation
¶
Index ¶
- Variables
- type Branch
- type BranchFilter
- type CodeRepositoryRequest
- type CodeRepositoryResponse
- type Credentials
- type Factory
- type GenericSCM
- func (s GenericSCM) GetFileContent(ctx context.Context, gitspaceConfig types.GitspaceConfig, filePath string, ...) ([]byte, error)
- func (s *GenericSCM) ListBranches(_ context.Context, _ *BranchFilter, _ *ResolvedCredentials) ([]Branch, error)
- func (s *GenericSCM) ListReporisotries(_ context.Context, _ *RepositoryFilter, _ *ResolvedCredentials) ([]Repository, error)
- func (s GenericSCM) ResolveCredentials(_ context.Context, gitspaceConfig types.GitspaceConfig) (*ResolvedCredentials, error)
- type GitnessSCM
- func (s GitnessSCM) GetFileContent(ctx context.Context, gitspaceConfig types.GitspaceConfig, filePath string, ...) ([]byte, error)
- func (s *GitnessSCM) ListBranches(ctx context.Context, filter *BranchFilter, _ *ResolvedCredentials) ([]Branch, error)
- func (s *GitnessSCM) ListReporisotries(ctx context.Context, filter *RepositoryFilter, _ *ResolvedCredentials) ([]Repository, error)
- func (s GitnessSCM) ResolveCredentials(ctx context.Context, gitspaceConfig types.GitspaceConfig) (*ResolvedCredentials, error)
- type Provider
- type Repository
- type RepositoryFilter
- type ResolvedCredentials
- type ResolvedDetails
- type SCM
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoDefaultBranch = errors.New("no default branch")
)
View Source
var WireSet = wire.NewSet( ProvideGitnessSCM, ProvideGenericSCM, ProvideFactory, ProvideSCM, )
WireSet provides a wire set for this package.
Functions ¶
This section is empty.
Types ¶
type BranchFilter ¶
type CodeRepositoryRequest ¶
type CodeRepositoryResponse ¶
type Credentials ¶
Credentials contains login and initialization information used by an automated login process.
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
func NewFactory ¶
func NewFactory(gitnessProvider *GitnessSCM, genericSCM *GenericSCM) Factory
func NewFactoryWithProviders ¶
func NewFactoryWithProviders(providers map[enum.GitspaceCodeRepoType]Provider) Factory
func ProvideFactory ¶
func ProvideFactory(gitness *GitnessSCM, genericSCM *GenericSCM) Factory
func (*Factory) GetSCMProvider ¶
func (f *Factory) GetSCMProvider(providerType enum.GitspaceCodeRepoType) (Provider, error)
type GenericSCM ¶
type GenericSCM struct {
}
func NewGenericSCM ¶
func NewGenericSCM() *GenericSCM
func ProvideGenericSCM ¶
func ProvideGenericSCM() *GenericSCM
func (GenericSCM) GetFileContent ¶
func (s GenericSCM) GetFileContent(ctx context.Context, gitspaceConfig types.GitspaceConfig, filePath string, _ *ResolvedCredentials, ) ([]byte, error)
func (*GenericSCM) ListBranches ¶
func (s *GenericSCM) ListBranches(_ context.Context, _ *BranchFilter, _ *ResolvedCredentials) ([]Branch, error)
ListBranches implements Provider.
func (*GenericSCM) ListReporisotries ¶
func (s *GenericSCM) ListReporisotries(_ context.Context, _ *RepositoryFilter, _ *ResolvedCredentials) ([]Repository, error)
ListReporisotries implements Provider.
func (GenericSCM) ResolveCredentials ¶
func (s GenericSCM) ResolveCredentials( _ context.Context, gitspaceConfig types.GitspaceConfig, ) (*ResolvedCredentials, error)
type GitnessSCM ¶
type GitnessSCM struct {
// contains filtered or unexported fields
}
func NewGitnessSCM ¶
func NewGitnessSCM(repoStore store.RepoStore, git git.Interface, tokenStore store.TokenStore, principalStore store.PrincipalStore, urlProvider urlprovider.Provider) *GitnessSCM
func ProvideGitnessSCM ¶
func ProvideGitnessSCM(repoStore store.RepoStore, rpcClient git.Interface, tokenStore store.TokenStore, principalStore store.PrincipalStore, urlProvider urlprovider.Provider, ) *GitnessSCM
func (GitnessSCM) GetFileContent ¶
func (s GitnessSCM) GetFileContent(ctx context.Context, gitspaceConfig types.GitspaceConfig, filePath string, _ *ResolvedCredentials, ) ([]byte, error)
func (*GitnessSCM) ListBranches ¶
func (s *GitnessSCM) ListBranches(ctx context.Context, filter *BranchFilter, _ *ResolvedCredentials) ([]Branch, error)
ListBranches implements Provider.
func (*GitnessSCM) ListReporisotries ¶
func (s *GitnessSCM) ListReporisotries(ctx context.Context, filter *RepositoryFilter, _ *ResolvedCredentials) ([]Repository, error)
ListReporisotries implements Provider.
func (GitnessSCM) ResolveCredentials ¶
func (s GitnessSCM) ResolveCredentials( ctx context.Context, gitspaceConfig types.GitspaceConfig, ) (*ResolvedCredentials, error)
type Provider ¶
type Provider interface {
ResolveCredentials(ctx context.Context, gitspaceConfig types.GitspaceConfig) (*ResolvedCredentials, error)
GetFileContent(
ctx context.Context,
gitspaceConfig types.GitspaceConfig,
filePath string,
credentials *ResolvedCredentials,
) ([]byte, error)
ListReporisotries(ctx context.Context,
filter *RepositoryFilter,
credentials *ResolvedCredentials) ([]Repository, error)
ListBranches(ctx context.Context,
filter *BranchFilter,
credentials *ResolvedCredentials) ([]Branch, error)
}
type Repository ¶
type RepositoryFilter ¶
type ResolvedCredentials ¶
type ResolvedCredentials struct {
Branch string
CloneURL string
Credentials *Credentials
RepoName string
}
type ResolvedDetails ¶
type ResolvedDetails struct {
*ResolvedCredentials
DevcontainerConfig *types.DevcontainerConfig
}
type SCM ¶
type SCM interface {
// GetSCMRepoDetails fetches repository name, credentials & devcontainer config file from the given repo and branch.
GetSCMRepoDetails(
ctx context.Context,
gitspaceConfig types.GitspaceConfig,
) (*ResolvedDetails, error)
// CheckValidCodeRepo checks if the current URL is a valid and accessible code repo,
// input can be connector info, user token etc.
CheckValidCodeRepo(ctx context.Context, request CodeRepositoryRequest) (*CodeRepositoryResponse, error)
}
func ProvideSCM ¶
Click to show internal directories.
Click to hide internal directories.