Documentation ¶
Overview ¶
Package vcs package
Index ¶
- func NewVCSProviderMap(logger logger.Logger, client *http.Client, phobosURL string) (map[models.VCSProviderType]Provider, error)
- type CreateOrganizationVCSProviderInput
- type CreateProjectVCSProviderInput
- type CreateVCSProviderResponse
- type CreateVCSTokenForPipelineInput
- type CreateVCSTokenForPipelineResponse
- type DeleteVCSProviderInput
- type GetRepositoryArchiveInput
- type GetVCSProvidersInput
- type MockProvider
- func (_m *MockProvider) BuildOAuthAuthorizationURL(input *types.BuildOAuthAuthorizationURLInput) (string, error)
- func (_m *MockProvider) BuildRepositoryURL(input *types.BuildRepositoryURLInput) (string, error)
- func (_m *MockProvider) CreateAccessToken(ctx context.Context, input *types.CreateAccessTokenInput) (*types.AccessTokenPayload, error)
- func (_m *MockProvider) DefaultURL() url.URL
- func (_m *MockProvider) GetArchive(ctx context.Context, input *types.GetArchiveInput) (*http.Response, error)
- func (_m *MockProvider) TestConnection(ctx context.Context, input *types.TestConnectionInput) error
- type ProcessOAuthInput
- type Provider
- type ResetVCSProviderOAuthTokenInput
- type ResetVCSProviderOAuthTokenResponse
- type Service
- type UpdateVCSProviderInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CreateOrganizationVCSProviderInput ¶
type CreateOrganizationVCSProviderInput struct { URL *string OAuthClientID *string OAuthClientSecret *string PersonalAccessToken *string OrganizationID string Name string Description string Type models.VCSProviderType AuthType models.VCSProviderAuthType ExtraOAuthScopes []string }
CreateOrganizationVCSProviderInput is the input for creating an organization VCS provider.
type CreateProjectVCSProviderInput ¶
type CreateProjectVCSProviderInput struct { URL *string OAuthClientID *string OAuthClientSecret *string PersonalAccessToken *string ProjectID string Name string Description string Type models.VCSProviderType AuthType models.VCSProviderAuthType ExtraOAuthScopes []string }
CreateProjectVCSProviderInput is the input for creating a project VCS provider.
type CreateVCSProviderResponse ¶
type CreateVCSProviderResponse struct { VCSProvider *models.VCSProvider OAuthAuthorizationURL *string }
CreateVCSProviderResponse is the response for creating a VCS provider
type CreateVCSTokenForPipelineInput ¶ added in v0.8.0
CreateVCSTokenForPipelineInput is the input for creating a VCS token.
type CreateVCSTokenForPipelineResponse ¶ added in v0.8.0
CreateVCSTokenForPipelineResponse is the response for creating a VCS token.
type DeleteVCSProviderInput ¶
DeleteVCSProviderInput is the input for deleting a VCS provider.
type GetRepositoryArchiveInput ¶
GetRepositoryArchiveInput is the input for retrieving a repository archive.
type GetVCSProvidersInput ¶
type GetVCSProvidersInput struct { // Sort specifies the field to sort on and direction Sort *db.VCSProviderSortableField // PaginationOptions supports cursor based pagination PaginationOptions *pagination.Options // Search returns only the VCS providers with a name that // starts with the value of search Search *string // OrganizationID is the organization ID to filter VCS providers on OrganizationID *string // ProjectID is the project ID to filter VCS provider on ProjectID *string }
GetVCSProvidersInput is the input for listing VCS providers.
type MockProvider ¶
MockProvider is an autogenerated mock type for the Provider type
func NewMockProvider ¶
func NewMockProvider(t mockConstructorTestingTNewMockProvider) *MockProvider
NewMockProvider creates a new instance of MockProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockProvider) BuildOAuthAuthorizationURL ¶
func (_m *MockProvider) BuildOAuthAuthorizationURL(input *types.BuildOAuthAuthorizationURLInput) (string, error)
BuildOAuthAuthorizationURL provides a mock function with given fields: input
func (*MockProvider) BuildRepositoryURL ¶
func (_m *MockProvider) BuildRepositoryURL(input *types.BuildRepositoryURLInput) (string, error)
BuildRepositoryURL provides a mock function with given fields: input
func (*MockProvider) CreateAccessToken ¶
func (_m *MockProvider) CreateAccessToken(ctx context.Context, input *types.CreateAccessTokenInput) (*types.AccessTokenPayload, error)
CreateAccessToken provides a mock function with given fields: ctx, input
func (*MockProvider) DefaultURL ¶
func (_m *MockProvider) DefaultURL() url.URL
DefaultURL provides a mock function with given fields:
func (*MockProvider) GetArchive ¶
func (_m *MockProvider) GetArchive(ctx context.Context, input *types.GetArchiveInput) (*http.Response, error)
GetArchive provides a mock function with given fields: ctx, input
func (*MockProvider) TestConnection ¶
func (_m *MockProvider) TestConnection(ctx context.Context, input *types.TestConnectionInput) error
TestConnection provides a mock function with given fields: ctx, input
type ProcessOAuthInput ¶
ProcessOAuthInput is the input for processing OAuth callback.
type Provider ¶
type Provider interface { DefaultURL() url.URL BuildOAuthAuthorizationURL(input *types.BuildOAuthAuthorizationURLInput) (string, error) BuildRepositoryURL(input *types.BuildRepositoryURLInput) (string, error) TestConnection(ctx context.Context, input *types.TestConnectionInput) error GetArchive(ctx context.Context, input *types.GetArchiveInput) (*http.Response, error) CreateAccessToken(ctx context.Context, input *types.CreateAccessTokenInput) (*types.AccessTokenPayload, error) }
Provider handles the logic for a specific type of vcs provider.
type ResetVCSProviderOAuthTokenInput ¶
type ResetVCSProviderOAuthTokenInput struct {
ProviderID string
}
ResetVCSProviderOAuthTokenInput is the input for
type ResetVCSProviderOAuthTokenResponse ¶
type ResetVCSProviderOAuthTokenResponse struct { VCSProvider *models.VCSProvider OAuthAuthorizationURL string }
ResetVCSProviderOAuthTokenResponse is the response for resetting a VCS OAuth token.
type Service ¶
type Service interface { GetVCSProviderByID(ctx context.Context, id string) (*models.VCSProvider, error) GetVCSProviderByPRN(ctx context.Context, prn string) (*models.VCSProvider, error) GetVCSProviders(ctx context.Context, input *GetVCSProvidersInput) (*db.VCSProvidersResult, error) GetVCSProvidersByIDs(ctx context.Context, idList []string) ([]models.VCSProvider, error) CreateOrganizationVCSProvider(ctx context.Context, input *CreateOrganizationVCSProviderInput) (*CreateVCSProviderResponse, error) CreateProjectVCSProvider(ctx context.Context, input *CreateProjectVCSProviderInput) (*CreateVCSProviderResponse, error) UpdateVCSProvider(ctx context.Context, input *UpdateVCSProviderInput) (*models.VCSProvider, error) DeleteVCSProvider(ctx context.Context, input *DeleteVCSProviderInput) error ResetVCSProviderOAuthToken(ctx context.Context, input *ResetVCSProviderOAuthTokenInput) (*ResetVCSProviderOAuthTokenResponse, error) ProcessOAuth(ctx context.Context, input *ProcessOAuthInput) error GetRepositoryArchive(ctx context.Context, input *GetRepositoryArchiveInput) (io.ReadCloser, error) CreateVCSTokenForPipeline(ctx context.Context, input *CreateVCSTokenForPipelineInput) (*CreateVCSTokenForPipelineResponse, error) }
Service implements all the functionality related to VCSProviders.
func NewService ¶
func NewService( logger logger.Logger, dbClient *db.Client, limitChecker limits.LimitChecker, activityService activityevent.Service, httpClient *http.Client, phobosURL string, ) (Service, error)
NewService returns an instance of Service.