Documentation ¶
Index ¶
- Constants
- Variables
- func Configure(api *operations.ClaAPI, service Service, eventService events.Service)
- type GithubOrgRepo
- type Repository
- func (r *Repository) GitHubAddRepository(ctx context.Context, externalProjectID string, projectSFID string, ...) (*models.GithubRepository, error)
- func (r *Repository) GitHubDisableRepositoriesByProjectID(ctx context.Context, projectID string) error
- func (r *Repository) GitHubDisableRepositoriesOfOrganization(ctx context.Context, projectSFID, githubOrgName string) error
- func (r *Repository) GitHubDisableRepositoriesOfOrganizationParent(ctx context.Context, parentProjectSFID, githubOrgName string) error
- func (r *Repository) GitHubDisableRepository(ctx context.Context, repositoryID string) error
- func (r *Repository) GitHubEnableRepository(ctx context.Context, repositoryID string) error
- func (r *Repository) GitHubEnableRepositoryWithCLAGroupID(ctx context.Context, repositoryID, claGroupID string) error
- func (r *Repository) GitHubGetCLAGroupRepositoriesGroupByOrgs(ctx context.Context, projectID string, enabled bool) ([]*models.GithubRepositoriesGroupByOrgs, error)
- func (r *Repository) GitHubGetRepositoriesByCLAGroup(ctx context.Context, claGroupID string, enabled bool) ([]*models.GithubRepository, error)
- func (r *Repository) GitHubGetRepositoriesByOrganizationName(ctx context.Context, gitHubOrgName string) ([]*models.GithubRepository, error)
- func (r *Repository) GitHubGetRepository(ctx context.Context, repositoryID string) (*models.GithubRepository, error)
- func (r *Repository) GitHubGetRepositoryByExternalID(ctx context.Context, repositoryExternalID string) (*models.GithubRepository, error)
- func (r *Repository) GitHubGetRepositoryByGithubID(ctx context.Context, externalID string, enabled bool) (*models.GithubRepository, error)
- func (r *Repository) GitHubGetRepositoryByName(ctx context.Context, repositoryName string) (*models.GithubRepository, error)
- func (r *Repository) GitHubListProjectRepositories(ctx context.Context, projectSFID string, enabled *bool) (*models.GithubListRepositories, error)
- func (r *Repository) GitHubSetRemoteDeletedRepository(ctx context.Context, repositoryID string, isDeleted bool, wasCLAEnforced bool) error
- func (r *Repository) GitHubUpdateClaGroupID(ctx context.Context, repositoryID, claGroupID string) error
- func (r *Repository) GitHubUpdateRepository(ctx context.Context, repositoryID, projectSFID, parentProjectSFID string, ...) (*models.GithubRepository, error)
- type RepositoryDBModel
- type RepositoryInterface
- type Service
Constants ¶
const RepositoryCLAGroupIDColumn = "repository_project_id"
RepositoryCLAGroupIDColumn constant
const RepositoryDateModifiedColumn = "date_modified"
RepositoryDateModifiedColumn constant
const RepositoryDisabled = "disabled"
RepositoryDisabled constant
const RepositoryEnabled = "enabled"
RepositoryEnabled constant
const RepositoryEnabledColumn = "enabled"
RepositoryEnabledColumn constant
const RepositoryExternalIDColumn = "repository_external_id"
RepositoryExternalIDColumn constant
const RepositoryExternalIDIndex = "external-repository-index"
RepositoryExternalIDIndex constant
const RepositoryIDColumn = "repository_id"
RepositoryIDColumn constant
const RepositoryNameColumn = "repository_name"
RepositoryNameColumn constant
const RepositoryNameIndex = "repository-name-index"
RepositoryNameIndex constant
const RepositoryNoteColumn = "note"
RepositoryNoteColumn constant
const RepositoryOrganizationNameColumn = "repository_organization_name"
RepositoryOrganizationNameColumn constant
const RepositoryOrganizationNameIndex = "repository-organization-name-index"
RepositoryOrganizationNameIndex constant
const RepositoryProjectIDColumn = "project_sfid"
RepositoryProjectIDColumn constant
const RepositoryProjectIndex = "project-repository-index"
RepositoryProjectIndex constant
const RepositoryProjectSFIDIndex = "project-sfid-repository-index"
RepositoryProjectSFIDIndex constant
const RepositoryProjectSFIDOrganizationNameIndex = "project-sfid-repository-organization-name-index"
RepositoryProjectSFIDOrganizationNameIndex constant
const RepositoryTypeColumn = "repository_type"
RepositoryTypeColumn constant
const RepositoryTypeIndex = "repository-type-index"
RepositoryTypeIndex constant
Variables ¶
var ErrRepositoryDoesNotExist = errors.New("repository does not exist")
ErrRepositoryDoesNotExist ...
Functions ¶
Types ¶
type GithubOrgRepo ¶
type GithubOrgRepo interface { GetGitHubOrganizationByName(ctx context.Context, githubOrganizationName string) (*models.GithubOrganizations, error) GetGitHubOrganization(ctx context.Context, githubOrganizationName string) (*models.GithubOrganization, error) GetGitHubOrganizations(ctx context.Context, projectSFID string) (*models.GithubOrganizations, error) }
GithubOrgRepo provide method to get github organization by name
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository structure
func NewRepository ¶
func NewRepository(awsSession *session.Session, stage string) *Repository
NewRepository create new Repository
func (*Repository) GitHubAddRepository ¶
func (r *Repository) GitHubAddRepository(ctx context.Context, externalProjectID string, projectSFID string, input *models.GithubRepositoryInput) (*models.GithubRepository, error)
GitHubAddRepository adds the specified repository
func (*Repository) GitHubDisableRepositoriesByProjectID ¶
func (r *Repository) GitHubDisableRepositoriesByProjectID(ctx context.Context, projectID string) error
GitHubDisableRepositoriesByProjectID disables the repository by the project ID
func (*Repository) GitHubDisableRepositoriesOfOrganization ¶
func (r *Repository) GitHubDisableRepositoriesOfOrganization(ctx context.Context, projectSFID, githubOrgName string) error
GitHubDisableRepositoriesOfOrganization disables the repositories under the GitHub organization
func (*Repository) GitHubDisableRepositoriesOfOrganizationParent ¶
func (r *Repository) GitHubDisableRepositoriesOfOrganizationParent(ctx context.Context, parentProjectSFID, githubOrgName string) error
GitHubDisableRepositoriesOfOrganizationParent disables the repositories under the GitHub organization for the parent project
func (*Repository) GitHubDisableRepository ¶
func (r *Repository) GitHubDisableRepository(ctx context.Context, repositoryID string) error
GitHubDisableRepository disables the repository entry (we don't delete)
func (*Repository) GitHubEnableRepository ¶
func (r *Repository) GitHubEnableRepository(ctx context.Context, repositoryID string) error
GitHubEnableRepository enables the repository entry
func (*Repository) GitHubEnableRepositoryWithCLAGroupID ¶
func (r *Repository) GitHubEnableRepositoryWithCLAGroupID(ctx context.Context, repositoryID, claGroupID string) error
GitHubEnableRepositoryWithCLAGroupID enables the repository entry with the specified CLA Group ID
func (*Repository) GitHubGetCLAGroupRepositoriesGroupByOrgs ¶
func (r *Repository) GitHubGetCLAGroupRepositoriesGroupByOrgs(ctx context.Context, projectID string, enabled bool) ([]*models.GithubRepositoriesGroupByOrgs, error)
GitHubGetCLAGroupRepositoriesGroupByOrgs returns a list of GH organizations by CLA Group - enabled flag indicates that we search the enabled repositories list
func (*Repository) GitHubGetRepositoriesByCLAGroup ¶
func (r *Repository) GitHubGetRepositoriesByCLAGroup(ctx context.Context, claGroupID string, enabled bool) ([]*models.GithubRepository, error)
GitHubGetRepositoriesByCLAGroup gets the list of repositories based on the CLA Group ID
func (*Repository) GitHubGetRepositoriesByOrganizationName ¶
func (r *Repository) GitHubGetRepositoriesByOrganizationName(ctx context.Context, gitHubOrgName string) ([]*models.GithubRepository, error)
GitHubGetRepositoriesByOrganizationName gets the repositories by organization name
func (*Repository) GitHubGetRepository ¶
func (r *Repository) GitHubGetRepository(ctx context.Context, repositoryID string) (*models.GithubRepository, error)
GitHubGetRepository by repository id
func (*Repository) GitHubGetRepositoryByExternalID ¶
func (r *Repository) GitHubGetRepositoryByExternalID(ctx context.Context, repositoryExternalID string) (*models.GithubRepository, error)
GitHubGetRepositoryByExternalID fetches the repository by repository ID
func (*Repository) GitHubGetRepositoryByGithubID ¶
func (r *Repository) GitHubGetRepositoryByGithubID(ctx context.Context, externalID string, enabled bool) (*models.GithubRepository, error)
GitHubGetRepositoryByGithubID fetches the repository model by its external GitHub id
func (*Repository) GitHubGetRepositoryByName ¶
func (r *Repository) GitHubGetRepositoryByName(ctx context.Context, repositoryName string) (*models.GithubRepository, error)
GitHubGetRepositoryByName fetches the repository by repository name
func (*Repository) GitHubListProjectRepositories ¶
func (r *Repository) GitHubListProjectRepositories(ctx context.Context, projectSFID string, enabled *bool) (*models.GithubListRepositories, error)
GitHubListProjectRepositories lists GitHub repositories of project by external/salesforce project id
func (*Repository) GitHubSetRemoteDeletedRepository ¶
func (r *Repository) GitHubSetRemoteDeletedRepository(ctx context.Context, repositoryID string, isDeleted bool, wasCLAEnforced bool) error
GitHubSetRemoteDeletedRepository used to set remotely deleted flag on repository
func (*Repository) GitHubUpdateClaGroupID ¶
func (r *Repository) GitHubUpdateClaGroupID(ctx context.Context, repositoryID, claGroupID string) error
GitHubUpdateClaGroupID updates the claGroupID of the repository
func (*Repository) GitHubUpdateRepository ¶
func (r *Repository) GitHubUpdateRepository(ctx context.Context, repositoryID, projectSFID, parentProjectSFID string, input *models.GithubRepositoryInput) (*models.GithubRepository, error)
GitHubUpdateRepository updates the repository record for given ID
type RepositoryDBModel ¶
type RepositoryDBModel struct { DateCreated string `dynamodbav:"date_created" json:"date_created,omitempty"` DateModified string `dynamodbav:"date_modified" json:"date_modified,omitempty"` RepositoryExternalID string `dynamodbav:"repository_external_id" json:"repository_external_id,omitempty"` // Integer value from GitHub RepositoryID string `dynamodbav:"repository_id" json:"repository_id,omitempty"` RepositoryName string `dynamodbav:"repository_name" json:"repository_name,omitempty"` RepositoryFullPath string `dynamodbav:"repository_full_path" json:"repository_full_path,omitempty"` RepositoryOrganizationName string `dynamodbav:"repository_organization_name" json:"repository_organization_name,omitempty"` RepositoryCLAGroupID string `dynamodbav:"repository_project_id" json:"repository_project_id,omitempty"` RepositorySfdcID string `dynamodbav:"repository_sfdc_id" json:"repository_sfdc_id,omitempty"` RepositoryType string `dynamodbav:"repository_type" json:"repository_type,omitempty"` RepositoryURL string `dynamodbav:"repository_url" json:"repository_url,omitempty"` ProjectSFID string `dynamodbav:"project_sfid" json:"project_sfid,omitempty"` Enabled bool `dynamodbav:"enabled" json:"enabled"` Note string `dynamodbav:"note" json:"note,omitempty"` Version string `dynamodbav:"version" json:"version,omitempty"` IsRemoteDeleted bool `dynamodbav:"is_remote_deleted" json:"is_transfered,omitempty"` WasCLAEnforced bool `dynamodbav:"was_cla_enforced" json:"was_cla_enforced,omitempty"` }
RepositoryDBModel represent repositories table
func (*RepositoryDBModel) ToGitHubModel ¶
func (gr *RepositoryDBModel) ToGitHubModel() *models.GithubRepository
ToGitHubModel returns the database model to a GitHub repository model suitable for marshalling to the client
type RepositoryInterface ¶
type RepositoryInterface interface { GitHubAddRepository(ctx context.Context, externalProjectID string, projectSFID string, input *models.GithubRepositoryInput) (*models.GithubRepository, error) GitHubUpdateRepository(ctx context.Context, repositoryID, projectSFID, parentProjectSFID string, input *models.GithubRepositoryInput) (*models.GithubRepository, error) GitHubUpdateClaGroupID(ctx context.Context, repositoryID, claGroupID string) error GitHubEnableRepository(ctx context.Context, repositoryID string) error GitHubEnableRepositoryWithCLAGroupID(ctx context.Context, repositoryID, claGroupID string) error GitHubDisableRepository(ctx context.Context, repositoryID string) error GitHubDisableRepositoriesByProjectID(ctx context.Context, projectID string) error GitHubDisableRepositoriesOfOrganization(ctx context.Context, externalProjectID, githubOrgName string) error GitHubDisableRepositoriesOfOrganizationParent(ctx context.Context, parentProjectSFID, githubOrgName string) error GitHubGetRepository(ctx context.Context, repositoryID string) (*models.GithubRepository, error) GitHubGetRepositoryByName(ctx context.Context, repositoryName string) (*models.GithubRepository, error) GitHubGetRepositoryByExternalID(ctx context.Context, repositoryExternalID string) (*models.GithubRepository, error) GitHubGetRepositoryByGithubID(ctx context.Context, externalID string, enabled bool) (*models.GithubRepository, error) GitHubGetRepositoriesByCLAGroup(ctx context.Context, claGroup string, enabled bool) ([]*models.GithubRepository, error) GitHubGetRepositoriesByOrganizationName(ctx context.Context, gitHubOrgName string) ([]*models.GithubRepository, error) GitHubGetCLAGroupRepositoriesGroupByOrgs(ctx context.Context, projectID string, enabled bool) ([]*models.GithubRepositoriesGroupByOrgs, error) GitHubListProjectRepositories(ctx context.Context, projectSFID string, enabled *bool) (*models.GithubListRepositories, error) GitHubSetRemoteDeletedRepository(ctx context.Context, repositoryID string, isDeleted bool, wasCLAEnforced bool) error }
RepositoryInterface contains functions of the repositories service
type Service ¶
type Service interface { AddGithubRepository(ctx context.Context, externalProjectID string, input *models.GithubRepositoryInput) (*models.GithubRepository, error) EnableRepository(ctx context.Context, repositoryID string) error EnableRepositoryWithCLAGroupID(ctx context.Context, repositoryID, claGroupID string) error DisableRepository(ctx context.Context, repositoryID string) error UpdateClaGroupID(ctx context.Context, repositoryID, claGroupID string) error ListProjectRepositories(ctx context.Context, externalProjectID string, enabled *bool) (*models.GithubListRepositories, error) GetRepository(ctx context.Context, repositoryID string) (*models.GithubRepository, error) GetRepositoryByProjectSFID(ctx context.Context, projectSFID string, enabled *bool) (*models.GithubListRepositories, error) GetRepositoryByName(ctx context.Context, repositoryName string) (*models.GithubRepository, error) GetRepositoryByExternalID(ctx context.Context, repositoryExternalID string) (*models.GithubRepository, error) DisableRepositoriesByProjectID(ctx context.Context, projectID string) (int, error) GetRepositoriesByCLAGroup(ctx context.Context, claGroupID string) ([]*models.GithubRepository, error) GetRepositoriesByOrganizationName(ctx context.Context, gitHubOrgName string) ([]*models.GithubRepository, error) }
Service contains functions of GitHub Repository service
func NewService ¶
func NewService(repo RepositoryInterface, ghOrgRepo GithubOrgRepo, pcgRepo projects_cla_groups.Repository) Service
NewService creates a new githubOrganizations service