Documentation ¶
Index ¶
- Constants
- Variables
- func Configure(api *operations.ClaAPI, service Service, projectService ProjectService, ...)
- type AccountsConfigInfo
- type AuthInfo
- type ChangeInfo
- type ContributorAgreementInfo
- type DownloadInfo
- type DownloadSchemesInfo
- type Gerrit
- type GerritInfo
- type GerritRepoInfo
- type GroupInfo
- type IndexConfigInfo
- type LDAPGroup
- type LFGroup
- func (lfg *LFGroup) AddUserToGroup(ctx context.Context, authUser *auth.User, ...) error
- func (lfg *LFGroup) GetGroup(ctx context.Context, groupID string) (*LDAPGroup, error)
- func (lfg *LFGroup) GetUsersOfGroup(ctx context.Context, authUser *auth.User, claGroupID, groupName string) (*v2Models.GerritGroupResponse, error)
- func (lfg *LFGroup) RemoveUserFromGroup(ctx context.Context, authUser *auth.User, ...) error
- type PluginConfigInfo
- type ProjectService
- type ReceiveInfo
- type Repository
- type ServerInfo
- type Service
- type SshdInfo
- type SuggestInfo
- type UserConfigInfo
- type WebLink
Constants ¶
const ( DefaultHTTPTimeout = 10 * time.Second LongHTTPTimeout = 45 * time.Second )
constants
Variables ¶
var ( ErrGerritNotFound = errors.New("gerrit not found") HugePageSize = int64(10000) )
errors
Functions ¶
func Configure ¶
func Configure(api *operations.ClaAPI, service Service, projectService ProjectService, eventService events.Service)
Configure the gerrit api
Types ¶
type AccountsConfigInfo ¶
type AccountsConfigInfo struct { Visibility string `json:"visibility"` DefaultDisplayName string `json:"default_display_name"` }
AccountsConfigInfo entity contains information about Gerrit configuration from the accounts section. https://gerrit.linuxfoundation.org/infra/Documentation/rest-api-config.html#accounts-config-info
type AuthInfo ¶
type AuthInfo struct { Type string `json:"type"` UseContributorAgreements bool `json:"use_contributor_agreements"` ContributorAgreements []ContributorAgreementInfo `json:"contributor_agreements"` EditableAccountFields []string `json:"editable_account_fields"` LoginURL string `json:"login_url"` LoginText string `json:"login_text"` SwitchAccountURL string `json:"switch_account_url"` RegisterURL string `json:"register_url"` RegisterText string `json:"register_text"` EditFullNameURL string `json:"edit_full_name_url"` HTTPPasswordURL string `json:"http_password_url"` GitBasicAuthPolicy string `json:"git_bacic_auth_policy"` }
AuthInfo entity contains information about the authentication configuration of the Gerrit server. https://gerrit.linuxfoundation.org/infra/Documentation/rest-api-config.html#auth-info
type ChangeInfo ¶
type ChangeInfo struct { AllowBlame bool `json:"allow_blame"` LargeChange int `json:"large_change"` ReplyLabel string `json:"reply_label"` }
ChangeInfo entity contains information about Gerrit configuration from the change section.- https://gerrit.linuxfoundation.org/infra/Documentation/rest-api-config.html#change-config-info
type ContributorAgreementInfo ¶
type ContributorAgreementInfo struct { Name string `json:"name"` Description string `json:"description"` URL string `json:"url"` AutoVerifyGroup GroupInfo `json:"auto_verify_group"` }
ContributorAgreementInfo entity contains information about a contributor agreement. https://gerrit.linuxfoundation.org/infra/Documentation/rest-api-accounts.html#contributor-agreement-info
type DownloadInfo ¶
type DownloadInfo struct { Schemes DownloadSchemesInfo `json:"schemes"` Archives []string `json:"archives"` }
DownloadInfo entity contains information about supported download options. - https://gerrit.linuxfoundation.org/infra/Documentation/rest-api-config.html#download-info
type DownloadSchemesInfo ¶
type DownloadSchemesInfo struct { URL string `json:"url"` IsAuthRequired bool `json:"is_auth_required"` IsAuthSupported bool `json:"is_auth_supported"` }
DownloadSchemesInfo entity contains information about a supported download scheme and its commands. https://gerrit.linuxfoundation.org/infra/Documentation/rest-api-config.html#download-scheme-info
type Gerrit ¶
type Gerrit struct { DateCreated string `json:"date_created,omitempty"` DateModified string `json:"date_modified,omitempty"` GerritID string `json:"gerrit_id,omitempty"` GerritName string `json:"gerrit_name,omitempty"` GerritURL string `json:"gerrit_url,omitempty"` GroupIDCcla string `json:"group_id_ccla,omitempty"` GroupIDIcla string `json:"group_id_icla,omitempty"` GroupNameCcla string `json:"group_name_ccla,omitempty"` GroupNameIcla string `json:"group_name_icla,omitempty"` ProjectSFID string `json:"project_sfid,omitempty"` ProjectID string `json:"project_id,omitempty"` Version string `json:"version,omitempty"` }
Gerrit represent gerrit instances table
type GerritInfo ¶
type GerritInfo struct { AllProjectsName string `json:"all_projects_name"` AllUsersName string `json:"all_users_name"` DocURL string `json:"doc_url"` ReportBugURL string `json:"report_bug_url"` DocSearch bool `json:"doc_search"` EditPGPKeys bool `json:"edit_pgp_keys"` }
GerritInfo entity contains information about Gerrit configuration from the gerrit section. https://gerrit.linuxfoundation.org/infra/Documentation/rest-api-config.html#gerrit-info
type GerritRepoInfo ¶
type GerritRepoInfo struct { ID string `json:"id"` Description string `json:"description"` State string `json:"state"` WebLinks []WebLink `json:"web_links"` }
GerritRepoInfo a simplified gerrit repo information data model
type GroupInfo ¶
type GroupInfo struct { ID string `json:"id"` Name string `json:"name"` URL string `json:"url"` Options string `json:"options"` Description string `json:"description"` GroupID string `json:"group_id"` Owner string `json:"owner"` OwnerID string `json:"owner_id"` CreatedOn string `json:"created_on"` }
GroupInfo entity contains information about a group. This can be a Gerrit internal group, or an external group that is known to Gerrit. https://gerrit.linuxfoundation.org/infra/Documentation/rest-api-groups.html#group-info
type LFGroup ¶
type LFGroup struct { LfBaseURL string ClientID string ClientSecret string RefreshToken string EventsService events.Service }
LFGroup contains access information of lf LDAP group
func (*LFGroup) AddUserToGroup ¶
func (lfg *LFGroup) AddUserToGroup(ctx context.Context, authUser *auth.User, claGroupID, groupName, userName string) error
AddUserToGroup adds the specified user to the group
type ProjectService ¶
type ProjectService interface {
GetCLAGroupByID(ctx context.Context, claGroupID string) (*models.ClaGroup, error)
}
ProjectService contains Project methods
type Repository ¶
type Repository interface { AddGerrit(ctx context.Context, input *models.Gerrit) (*models.Gerrit, error) GetGerrit(ctx context.Context, gerritID string) (*models.Gerrit, error) GetGerritsByID(ctx context.Context, ID string, IDType string) (*models.GerritList, error) GetGerritsByProjectSFID(ctx context.Context, projectSFID string) (*models.GerritList, error) GetClaGroupGerrits(ctx context.Context, claGroupID string) (*models.GerritList, error) ExistsByName(ctx context.Context, gerritName string) ([]*models.Gerrit, error) DeleteGerrit(ctx context.Context, gerritID string) error }
Repository defines functions of V3Repositories
func NewRepository ¶
func NewRepository(awsSession *session.Session, stage string) Repository
NewRepository create new Repository
type ServerInfo ¶
type ServerInfo struct { Accounts AccountsConfigInfo `json:"accounts"` Auth AuthInfo `json:"auth"` Change ChangeInfo `json:"change"` Download DownloadInfo `json:"download"` Gerrit GerritInfo `json:"gerrit"` Index IndexConfigInfo `json:"index"` Plugin PluginConfigInfo `json:"plugin"` Receive ReceiveInfo `json:"receive"` SSHD SshdInfo `json:"sshd"` Suggest SuggestInfo `json:"suggest"` User UserConfigInfo `json:"user"` DefaultTheme string `json:"default_theme"` }
ServerInfo is the response model returned from the server config query
type Service ¶
type Service interface { AddGerrit(ctx context.Context, claGroupID string, projectSFID string, input *models.AddGerritInput, claGroupModel *models.ClaGroup) (*models.Gerrit, error) GetGerrit(ctx context.Context, gerritID string) (*models.Gerrit, error) GetGerritsByProjectSFID(ctx context.Context, projectSFID string) (*models.GerritList, error) GetClaGroupGerrits(ctx context.Context, claGroupID string) (*models.GerritList, error) GetGerritRepos(ctx context.Context, gerritName string) (*models.GerritRepoList, error) DeleteClaGroupGerrits(ctx context.Context, claGroupID string) (int, error) DeleteGerrit(ctx context.Context, gerritID string) error }
Service handles gerrit Repository service