Documentation ¶
Index ¶
- Constants
- Variables
- func Configure(api *operations.ClaAPI, service ServiceInterface, eventService events.Service)
- func ToModel(in *GithubOrganization) *models.GithubOrganization
- type GithubOrganization
- type Repository
- func (repo Repository) AddGitHubOrganization(ctx context.Context, parentProjectSFID string, projectSFID string, ...) (*models.GithubOrganization, error)
- func (repo Repository) DeleteGitHubOrganization(ctx context.Context, projectSFID string, githubOrgName string) error
- func (repo Repository) DeleteGitHubOrganizationByParent(ctx context.Context, parentProjectSFID string, githubOrgName string) error
- func (repo Repository) GetGitHubOrganization(ctx context.Context, githubOrganizationName string) (*models.GithubOrganization, error)
- func (repo Repository) GetGitHubOrganizationByName(ctx context.Context, githubOrganizationName string) (*models.GithubOrganizations, error)
- func (repo Repository) GetGitHubOrganizations(ctx context.Context, projectSFID string) (*models.GithubOrganizations, error)
- func (repo Repository) GetGitHubOrganizationsByParent(ctx context.Context, parentProjectSFID string) (*models.GithubOrganizations, error)
- func (repo Repository) UpdateGitHubOrganization(ctx context.Context, projectSFID string, organizationName string, ...) error
- type RepositoryInterface
- type Service
- func (s Service) AddGitHubOrganization(ctx context.Context, projectSFID string, ...) (*models.GithubOrganization, error)
- func (s Service) DeleteGitHubOrganization(ctx context.Context, projectSFID string, githubOrgName string) error
- func (s Service) GetGitHubOrganizationByName(ctx context.Context, githubOrgName string) (*models.GithubOrganization, error)
- func (s Service) GetGitHubOrganizations(ctx context.Context, projectSFID string) (*models.GithubOrganizations, error)
- func (s Service) GetGitHubOrganizationsByParent(ctx context.Context, parentProjectSFID string) (*models.GithubOrganizations, error)
- func (s Service) RemoveDuplicates(input []*models.GithubOrganization) []*models.GithubOrganization
- func (s Service) UpdateGitHubOrganization(ctx context.Context, projectSFID string, organizationName string, ...) error
- type ServiceInterface
Constants ¶
const ( GithubOrgSFIDIndex = "github-org-sfid-index" GithubOrgLowerNameIndex = "organization-name-lower-search-index" ProjectSFIDOrganizationNameIndex = "project-sfid-organization-name-index" )
indexes
Variables ¶
var ( // ErrOrganizationDoesNotExist organization does not exist error ErrOrganizationDoesNotExist = errors.New("github organization does not exist in cla") )
Functions ¶
func Configure ¶
func Configure(api *operations.ClaAPI, service ServiceInterface, eventService events.Service)
Configure setups handlers on api with service
func ToModel ¶
func ToModel(in *GithubOrganization) *models.GithubOrganization
ToModel converts to models.GithubOrganization
Types ¶
type GithubOrganization ¶
type GithubOrganization struct { DateCreated string `json:"date_created,omitempty"` DateModified string `json:"date_modified,omitempty"` OrganizationInstallationID int64 `json:"organization_installation_id,omitempty"` OrganizationName string `json:"organization_name,omitempty"` OrganizationNameLower string `json:"organization_name_lower,omitempty"` OrganizationSFID string `json:"organization_sfid,omitempty"` ProjectSFID string `json:"project_sfid"` Enabled bool `json:"enabled"` AutoEnabled bool `json:"auto_enabled"` BranchProtectionEnabled bool `json:"branch_protection_enabled"` AutoEnabledClaGroupID string `json:"auto_enabled_cla_group_id,omitempty"` Version string `json:"version,omitempty"` }
GithubOrganization is data model for github organizations
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository object/struct
func NewRepository ¶
func NewRepository(awsSession *session.Session, stage string) Repository
NewRepository creates a new instance of the githubOrganizations repository
func (Repository) AddGitHubOrganization ¶
func (repo Repository) AddGitHubOrganization(ctx context.Context, parentProjectSFID string, projectSFID string, input *models.GithubCreateOrganization) (*models.GithubOrganization, error)
AddGitHubOrganization add github organization logic
func (Repository) DeleteGitHubOrganization ¶
func (repo Repository) DeleteGitHubOrganization(ctx context.Context, projectSFID string, githubOrgName string) error
DeleteGitHubOrganization deletes the github organization by project SFID
func (Repository) DeleteGitHubOrganizationByParent ¶
func (repo Repository) DeleteGitHubOrganizationByParent(ctx context.Context, parentProjectSFID string, githubOrgName string) error
DeleteGitHubOrganizationByParent deletes the github organization by parent SFID
func (Repository) GetGitHubOrganization ¶
func (repo Repository) GetGitHubOrganization(ctx context.Context, githubOrganizationName string) (*models.GithubOrganization, error)
GetGitHubOrganization by organization name
func (Repository) GetGitHubOrganizationByName ¶
func (repo Repository) GetGitHubOrganizationByName(ctx context.Context, githubOrganizationName string) (*models.GithubOrganizations, error)
GetGitHubOrganizationByName get github organization by name
func (Repository) GetGitHubOrganizations ¶
func (repo Repository) GetGitHubOrganizations(ctx context.Context, projectSFID string) (*models.GithubOrganizations, error)
GetGitHubOrganizations get github organizations based on the project SFID
func (Repository) GetGitHubOrganizationsByParent ¶
func (repo Repository) GetGitHubOrganizationsByParent(ctx context.Context, parentProjectSFID string) (*models.GithubOrganizations, error)
GetGitHubOrganizationsByParent returns a list of github organizations by parent project SFID
func (Repository) UpdateGitHubOrganization ¶
func (repo Repository) UpdateGitHubOrganization(ctx context.Context, projectSFID string, organizationName string, autoEnabled bool, autoEnabledClaGroupID string, branchProtectionEnabled bool, enabled *bool) error
UpdateGitHubOrganization updates the specified GitHub organization based on the update model provided
type RepositoryInterface ¶
type RepositoryInterface interface { AddGitHubOrganization(ctx context.Context, parentProjectSFID string, projectSFID string, input *models.GithubCreateOrganization) (*models.GithubOrganization, error) GetGitHubOrganizations(ctx context.Context, projectSFID string) (*models.GithubOrganizations, error) GetGitHubOrganizationsByParent(ctx context.Context, parentProjectSFID string) (*models.GithubOrganizations, error) GetGitHubOrganization(ctx context.Context, githubOrganizationName string) (*models.GithubOrganization, error) GetGitHubOrganizationByName(ctx context.Context, githubOrganizationName string) (*models.GithubOrganizations, error) UpdateGitHubOrganization(ctx context.Context, projectSFID string, organizationName string, autoEnabled bool, autoEnabledClaGroupID string, branchProtectionEnabled bool, enabled *bool) error DeleteGitHubOrganization(ctx context.Context, projectSFID string, githubOrgName string) error DeleteGitHubOrganizationByParent(ctx context.Context, parentProjectSFID string, githubOrgName string) error }
RepositoryInterface interface defines the functions for the github organizations data model
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service object/struct
func NewService ¶
func NewService(repo RepositoryInterface, ghRepository repositories.RepositoryInterface, claRepository projects_cla_groups.Repository) Service
NewService creates a new githubOrganizations service
func (Service) AddGitHubOrganization ¶
func (s Service) AddGitHubOrganization(ctx context.Context, projectSFID string, input *models.GithubCreateOrganization) (*models.GithubOrganization, error)
AddGitHubOrganization adds the GitHub organization for the specified project
func (Service) DeleteGitHubOrganization ¶
func (s Service) DeleteGitHubOrganization(ctx context.Context, projectSFID string, githubOrgName string) error
DeleteGitHubOrganization removes the specified github organization under the projectSFID
func (Service) GetGitHubOrganizationByName ¶
func (s Service) GetGitHubOrganizationByName(ctx context.Context, githubOrgName string) (*models.GithubOrganization, error)
GetGitHubOrganizationByName returns the GitHub organizations for the specified GitHub organization name
func (Service) GetGitHubOrganizations ¶
func (s Service) GetGitHubOrganizations(ctx context.Context, projectSFID string) (*models.GithubOrganizations, error)
GetGitHubOrganizations returns the GitHub organization for the specified project
func (Service) GetGitHubOrganizationsByParent ¶
func (s Service) GetGitHubOrganizationsByParent(ctx context.Context, parentProjectSFID string) (*models.GithubOrganizations, error)
GetGitHubOrganizationsByParent returns the GitHub organizations for the specified parent project SFID
func (Service) RemoveDuplicates ¶
func (s Service) RemoveDuplicates(input []*models.GithubOrganization) []*models.GithubOrganization
RemoveDuplicates removes any duplicates from the specified list
func (Service) UpdateGitHubOrganization ¶
func (s Service) UpdateGitHubOrganization(ctx context.Context, projectSFID string, organizationName string, autoEnabled bool, autoEnabledClaGroupID string, branchProtectionEnabled bool) error
UpdateGitHubOrganization updates the specified github organization based on the project SFID, organization name provided values
type ServiceInterface ¶
type ServiceInterface interface { AddGitHubOrganization(ctx context.Context, projectSFID string, input *models.GithubCreateOrganization) (*models.GithubOrganization, error) GetGitHubOrganizations(ctx context.Context, projectSFID string) (*models.GithubOrganizations, error) GetGitHubOrganizationsByParent(ctx context.Context, parentProjectSFID string) (*models.GithubOrganizations, error) GetGitHubOrganizationByName(ctx context.Context, githubOrgName string) (*models.GithubOrganization, error) UpdateGitHubOrganization(ctx context.Context, projectSFID string, organizationName string, autoEnabled bool, autoEnabledClaGroupID string, branchProtectionEnabled bool) error DeleteGitHubOrganization(ctx context.Context, projectSFID string, githubOrgName string) error RemoveDuplicates(input []*models.GithubOrganization) []*models.GithubOrganization }
ServiceInterface contains functions of GithubOrganizations service