Documentation
¶
Index ¶
- type AdapterFinderStub
- type AuthStub
- type AzureTenantResolverStub
- type CLIRunnerStub
- type CommitSignerStub
- type CredentialResolverStub
- type ForgeProviderStub
- func (s *ForgeProviderStub) AuthToken() string
- func (s *ForgeProviderStub) CloneURL(_ globalEntities.Repository) string
- func (s *ForgeProviderStub) ClosePullRequest(_ context.Context, _ globalEntities.Repository, _ string) (bool, error)
- func (s *ForgeProviderStub) ConfigureTransport()
- func (s *ForgeProviderStub) CreatePullRequest(_ context.Context, _ globalEntities.Repository, ...) (*globalEntities.PullRequest, error)
- func (s *ForgeProviderStub) DiscoverRepositories(_ context.Context, _ string) ([]globalEntities.Repository, error)
- func (s *ForgeProviderStub) GetAuthMethods(_ string) []transport.AuthMethod
- func (s *ForgeProviderStub) GetServiceType() globalEntities.ServiceType
- func (s *ForgeProviderStub) MatchesURL(rawURL string) bool
- func (s *ForgeProviderStub) Name() string
- func (s *ForgeProviderStub) PrepareCloneURL(url string) string
- func (s *ForgeProviderStub) PullRequestExists(_ context.Context, _ globalEntities.Repository, _ string) (bool, error)
- func (s *ForgeProviderStub) SSHCloneURL(_ globalEntities.Repository, _ string) string
- type MirrorProviderStub
- type RepositoryDiscovererStub
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdapterFinderStub ¶
type AdapterFinderStub struct {
AdapterByServiceTypeValue globalEntities.LocalGitAuthProvider
AdapterByURLValue globalEntities.LocalGitAuthProvider
}
AdapterFinderStub implements git.AdapterFinder for testing.
func (*AdapterFinderStub) GetAdapterByServiceType ¶
func (s *AdapterFinderStub) GetAdapterByServiceType( _ globalEntities.ServiceType, ) globalEntities.LocalGitAuthProvider
func (*AdapterFinderStub) GetAdapterByURL ¶
func (s *AdapterFinderStub) GetAdapterByURL(_ string) globalEntities.LocalGitAuthProvider
type AzureTenantResolverStub ¶ added in v4.7.0
type AzureTenantResolverStub struct {
Tenant string
Err error
// contains filtered or unexported fields
}
AzureTenantResolverStub is a recording credentials AzureTenantResolver that answers every organization with the same tenant or error, without network access.
func (*AzureTenantResolverStub) GetTenant ¶ added in v4.7.0
GetTenant records the organization and returns the configured tenant or error.
func (*AzureTenantResolverStub) Organizations ¶ added in v4.7.0
func (s *AzureTenantResolverStub) Organizations() []string
Organizations returns every organization GetTenant was asked about.
type CLIRunnerStub ¶ added in v4.7.0
type CLIRunnerStub struct {
// Paths maps a program name to the path LookPath returns. A name missing from it
// fails with LookPathErr, or with exec.ErrNotFound when that is nil.
Paths map[string]string
LookPathErr error
// Token is what every Output call prints, unless OutputErr is set.
Token string
OutputErr error
// Block makes Output wait until its context ends, then return the context's error.
Block bool
// contains filtered or unexported fields
}
CLIRunnerStub is a recording credentials CLIRunner: it answers LookPath and Output with canned values and remembers every command it was asked to run.
func (*CLIRunnerStub) Calls ¶ added in v4.7.0
func (s *CLIRunnerStub) Calls() [][]string
Calls returns every command Output ran, each as the path followed by its arguments.
type CommitSignerStub ¶
CommitSignerStub implements CommitSigner for testing.
type CredentialResolverStub ¶ added in v4.7.0
type CredentialResolverStub struct {
Credential credentialEntities.Credential
Err error
// contains filtered or unexported fields
}
CredentialResolverStub is a recording credentials CredentialResolver that answers every request with the same credential or error.
func (*CredentialResolverStub) Requests ¶ added in v4.7.0
func (s *CredentialResolverStub) Requests() []credentialEntities.CredentialRequest
Requests returns every request Resolve received.
func (*CredentialResolverStub) Resolve ¶ added in v4.7.0
func (s *CredentialResolverStub) Resolve( _ context.Context, request credentialEntities.CredentialRequest, ) (credentialEntities.Credential, error)
Resolve records the request and returns the configured credential or error.
type ForgeProviderStub ¶
type ForgeProviderStub struct {
NameValue string
MatchURLValue string
TokenValue string
ServiceTypeValue globalEntities.ServiceType
AuthMethodsValue []transport.AuthMethod
}
ForgeProviderStub implements ForgeProvider + LocalGitAuthProvider for testing.
func (*ForgeProviderStub) AuthToken ¶
func (s *ForgeProviderStub) AuthToken() string
func (*ForgeProviderStub) CloneURL ¶
func (s *ForgeProviderStub) CloneURL(_ globalEntities.Repository) string
func (*ForgeProviderStub) ClosePullRequest ¶
func (s *ForgeProviderStub) ClosePullRequest( _ context.Context, _ globalEntities.Repository, _ string, ) (bool, error)
func (*ForgeProviderStub) ConfigureTransport ¶
func (s *ForgeProviderStub) ConfigureTransport()
func (*ForgeProviderStub) CreatePullRequest ¶
func (s *ForgeProviderStub) CreatePullRequest( _ context.Context, _ globalEntities.Repository, _ globalEntities.PullRequestInput, ) (*globalEntities.PullRequest, error)
func (*ForgeProviderStub) DiscoverRepositories ¶
func (s *ForgeProviderStub) DiscoverRepositories( _ context.Context, _ string, ) ([]globalEntities.Repository, error)
func (*ForgeProviderStub) GetAuthMethods ¶
func (s *ForgeProviderStub) GetAuthMethods(_ string) []transport.AuthMethod
func (*ForgeProviderStub) GetServiceType ¶
func (s *ForgeProviderStub) GetServiceType() globalEntities.ServiceType
func (*ForgeProviderStub) MatchesURL ¶
func (s *ForgeProviderStub) MatchesURL(rawURL string) bool
func (*ForgeProviderStub) Name ¶
func (s *ForgeProviderStub) Name() string
func (*ForgeProviderStub) PrepareCloneURL ¶
func (s *ForgeProviderStub) PrepareCloneURL(url string) string
func (*ForgeProviderStub) PullRequestExists ¶
func (s *ForgeProviderStub) PullRequestExists( _ context.Context, _ globalEntities.Repository, _ string, ) (bool, error)
func (*ForgeProviderStub) SSHCloneURL ¶
func (s *ForgeProviderStub) SSHCloneURL(_ globalEntities.Repository, _ string) string
type MirrorProviderStub ¶
type MirrorProviderStub struct {
*ForgeProviderStub
MigrateErr error
Migrated []globalEntities.MirrorInput
}
MirrorProviderStub implements MirrorProvider for testing.
func (*MirrorProviderStub) MigrateRepository ¶
func (s *MirrorProviderStub) MigrateRepository( _ context.Context, input globalEntities.MirrorInput, ) error
type RepositoryDiscovererStub ¶
type RepositoryDiscovererStub struct {
NameValue string
}
RepositoryDiscovererStub implements RepositoryDiscoverer for testing.
func (*RepositoryDiscovererStub) DiscoverRepositories ¶
func (s *RepositoryDiscovererStub) DiscoverRepositories( _ context.Context, _ string, ) ([]globalEntities.Repository, error)
func (*RepositoryDiscovererStub) Name ¶
func (s *RepositoryDiscovererStub) Name() string