Documentation
¶
Index ¶
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 CodeRepositoryRequest ¶
type CodeRepositoryRequest struct {
URL string `json:"url"`
}
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, ) ([]byte, error)
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, ) ([]byte, error)
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, ) ([]byte, error) }
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.