Documentation
¶
Index ¶
- Constants
- type ApiUserResponse
- type ApiVersionResponse
- type GitlabAccount
- type GitlabApiParams
- type GitlabApiProject
- type GitlabCommit
- type GitlabConn
- type GitlabConnection
- type GitlabDeployment
- type GitlabIssue
- type GitlabIssueAssignee
- type GitlabIssueLabel
- type GitlabJob
- type GitlabMember
- type GitlabMergeRequest
- type GitlabMrComment
- type GitlabMrCommit
- type GitlabMrLabel
- type GitlabMrNote
- type GitlabPipeline
- type GitlabPipelineProject
- type GitlabProject
- type GitlabProjectCommit
- type GitlabResponse
- type GitlabReviewer
- type GitlabScopeConfig
- type GitlabTag
- type GitlabUser
- type GroupAccess
- type GroupResponse
- type Permissions
- type ProjectAccess
Constants ¶
View Source
const GitlabApiClientData_ApiVersion string = "ApiVersion"
View Source
const GitlabApiClientData_UserId string = "UserId"
View Source
const GitlabApiClientData_UserName string = "UserName"
View Source
const GitlabCloudEndPoint string = "https://gitlab.com/api/v4/"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiUserResponse ¶
Using User because it requires authentication.
type ApiVersionResponse ¶
type GitlabAccount ¶
type GitlabAccount struct {
ConnectionId uint64 `gorm:"primaryKey"`
GitlabId int `gorm:"primaryKey" json:"id"`
Username string `gorm:"type:varchar(255)"`
Email string `gorm:"type:varchar(255)"`
Name string `gorm:"type:varchar(255)"`
State string `gorm:"type:varchar(255)"`
MembershipState string `json:"membership_state" gorm:"type:varchar(255)"`
AvatarUrl string `json:"avatar_url" gorm:"type:varchar(255)"`
WebUrl string `json:"web_url" gorm:"type:varchar(255)"`
CreatedUserAt *time.Time `json:"created_at"`
common.NoPKModel
}
func (GitlabAccount) TableName ¶
func (GitlabAccount) TableName() string
type GitlabApiParams ¶
type GitlabApiProject ¶
type GitlabApiProject struct {
GitlabId int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
DefaultBranch string `json:"default_branch"`
PathWithNamespace string `json:"path_with_namespace"`
WebUrl string `json:"web_url"`
CreatorId int
Visibility string `json:"visibility"`
OpenIssuesCount int `json:"open_issues_count"`
StarCount int `json:"star_count"`
ForkedFromProject *GitlabApiProject `json:"forked_from_project"`
CreatedAt common.Iso8601Time `json:"created_at"`
LastActivityAt *common.Iso8601Time `json:"last_activity_at"`
HttpUrlToRepo string `json:"http_url_to_repo"`
Archived bool `json:"archived"`
Permissions Permissions `json:"permissions"`
Namespace struct {
ID int `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
Kind string `json:"kind"`
FullPath string `json:"full_path"`
ParentID any `json:"parent_id"`
} `json:"namespace"`
Owner struct {
ID int `json:"id"`
Name string `json:"name"`
} `json:"owner"`
}
func (GitlabApiProject) ConvertApiScope ¶
func (gitlabApiProject GitlabApiProject) ConvertApiScope() *GitlabProject
Convert the API response to our DB model instance
type GitlabCommit ¶
type GitlabCommit struct {
Sha string `gorm:"primaryKey;type:varchar(40)"`
Title string
Message string
ShortId string `gorm:"type:varchar(255)"`
AuthorName string `gorm:"type:varchar(255)"`
AuthorEmail string `gorm:"type:varchar(255)"`
AuthoredDate time.Time
CommitterName string `gorm:"type:varchar(255)"`
CommitterEmail string `gorm:"type:varchar(255)"`
CommittedDate time.Time
WebUrl string `gorm:"type:varchar(255)"`
Additions int `gorm:"comment:Added lines of code"`
Deletions int `gorm:"comment:Deleted lines of code"`
Total int `gorm:"comment:Sum of added/deleted lines of code"`
common.NoPKModel
}
func (GitlabCommit) TableName ¶
func (GitlabCommit) TableName() string
type GitlabConn ¶
type GitlabConn struct {
api.RestConnection `mapstructure:",squash"`
api.AccessToken `mapstructure:",squash"`
}
GitlabConn holds the essential information to connect to the Gitlab API
func (*GitlabConn) PrepareApiClient ¶
func (conn *GitlabConn) PrepareApiClient(apiClient plugin.ApiClient) errors.Error
PrepareApiClient test api and set the IsPrivateToken,version,UserId and so on.
func (*GitlabConn) Sanitize ¶
func (conn *GitlabConn) Sanitize() GitlabConn
func (*GitlabConn) SetupAuthentication ¶
func (conn *GitlabConn) SetupAuthentication(request *http.Request) errors.Error
this function is used to rewrite the same function of AccessToken
type GitlabConnection ¶
type GitlabConnection struct {
api.BaseConnection `mapstructure:",squash"`
GitlabConn `mapstructure:",squash"`
}
GitlabConnection holds GitlabConn plus ID/Name for database storage
func (*GitlabConnection) MergeFromRequest ¶
func (connection *GitlabConnection) MergeFromRequest(target *GitlabConnection, body map[string]interface{}) error
func (GitlabConnection) Sanitize ¶
func (connection GitlabConnection) Sanitize() GitlabConnection
func (GitlabConnection) TableName ¶
func (GitlabConnection) TableName() string
type GitlabDeployment ¶
type GitlabDeployment struct {
common.NoPKModel `swaggerignore:"true" json:"-" mapstructure:"-"`
ConnectionId uint64 `json:"connection_id" gorm:"primaryKey"`
GitlabId int `json:"gitlab_id" gorm:"primaryKey"`
CreatedDate time.Time `json:"created_date"`
UpdatedDate *time.Time `json:"updated_date"`
Status string `json:"status"` //created, running, success, failed, canceled, or blocked
DeploymentId int `json:"id" gorm:"primaryKey"`
Iid int `json:"iid"`
Ref string `json:"ref"`
Sha string `json:"sha"`
Environment string `json:"environment" gorm:"type:varchar(255)"`
Name string `json:"name" gorm:"type:varchar(255)"`
DeployableCommitAuthorEmail string `json:"deployable_commit_author_email" gorm:"type:varchar(255)"`
DeployableCommitAuthorName string `json:"deployable_commit_author_name" gorm:"type:varchar(255)"`
DeployableCommitCreatedAt *time.Time `json:"deployable_commit_created_at"`
DeployableCommitID string `json:"deployable_commit_id" gorm:"type:varchar(255)"`
DeployableCommitMessage string `json:"deployable_commit_message"`
DeployableCommitShortID string `json:"deployable_commit_short_id" gorm:"type:varchar(255)"`
DeployableCommitTitle string `json:"deployable_commit_title"`
//DeployableCoverage any `json:"deployable_coverage"`
DeployableCreatedAt *time.Time `json:"deployable_created_at"`
DeployableFinishedAt *time.Time `json:"deployable_finished_at"`
DeployableID int `json:"deployable_id"`
DeployableName string `json:"deployable_name" gorm:"type:varchar(255)"`
DeployableRef string `json:"deployable_ref" gorm:"type:varchar(255)"`
//DeployableRunner any `json:"deployable_runner"`
DeployableStage string `json:"deployable_stage" gorm:"type:varchar(255)"`
DeployableStartedAt *time.Time `json:"deployable_started_at"`
DeployableStatus string `json:"deployable_status" gorm:"type:varchar(255)"`
DeployableTag bool `json:"deployable_tag"`
DeployableDuration *float64 `json:"deployable_duration"`
QueuedDuration *float64 `json:"queued_duration"`
DeployableUserID int `json:"deployable_user_id"`
DeployableUserName string `json:"deployable_user_name" gorm:"type:varchar(255)"`
DeployableUserUsername string `json:"deployable_user_username" gorm:"type:varchar(255)"`
DeployableUserState string `json:"deployable_user_state" gorm:"type:varchar(255)"`
DeployableUserAvatarURL string `json:"deployable_user_avatar_url" gorm:"type:varchar(255)"`
DeployableUserWebURL string `json:"deployable_user_web_url" gorm:"type:varchar(255)"`
DeployableUserCreatedAt *time.Time `json:"deployable_user_created_at"`
//DeployableUserBio any `json:"deployable_user_bio"`
//DeployableUserLocation any `json:"deployable_user_location"`
DeployableUserPublicEmail string `json:"deployable_user_public_email" gorm:"type:varchar(255)"`
DeployableUserSkype string `json:"deployable_user_skype" gorm:"type:varchar(255)"`
DeployableUserLinkedin string `json:"deployable_user_linkedin" gorm:"type:varchar(255)"`
DeployableUserTwitter string `json:"deployable_user_twitter" gorm:"type:varchar(255)"`
DeployableUserWebsiteURL string `json:"deployable_user_website_url" gorm:"type:varchar(255)"`
DeployableUserOrganization string `json:"deployable_user_organization" gorm:"type:varchar(255)"`
DeployablePipelineCreatedAt *time.Time `json:"deployable_pipeline_created_at"`
DeployablePipelineID int `json:"deployable_pipeline_id"`
DeployablePipelineRef string `json:"deployable_pipeline_ref" gorm:"type:varchar(255)"`
DeployablePipelineSha string `json:"deployable_pipeline_sha" gorm:"type:varchar(255)"`
DeployablePipelineStatus string `json:"deployable_pipeline_status" gorm:"type:varchar(255)"`
DeployablePipelineUpdatedAt *time.Time `json:"deployable_pipeline_updated_at"`
DeployablePipelineWebURL string `json:"deployable_pipeline_web_url" gorm:"type:varchar(255)"`
UserAvatarURL string `json:"user_avatar_url" gorm:"type:varchar(255)"`
UserID int `json:"user_id"`
UserName string `json:"user_name" gorm:"type:varchar(255)"`
UserState string `json:"user_state" gorm:"type:varchar(255)"`
UserUsername string `json:"user_username" gorm:"type:varchar(255)"`
UserWebURL string `json:"user_web_url" gorm:"type:varchar(255)"`
}
func (GitlabDeployment) TableName ¶
func (GitlabDeployment) TableName() string
type GitlabIssue ¶
type GitlabIssue struct {
ConnectionId uint64 `gorm:"primaryKey"`
GitlabId int `gorm:"primaryKey"`
ProjectId int `gorm:"index"`
Number int `gorm:"index;comment:Used in API requests ex. api/repo/1/issue/<THIS_NUMBER>"`
State string `gorm:"type:varchar(255)"`
Title string
Body string
Priority string `gorm:"type:varchar(255)"`
Type string `gorm:"type:varchar(100)"`
StdType string `gorm:"type:varchar(100)"`
Status string `gorm:"type:varchar(255)"`
CreatorId int
CreatorName string `gorm:"type:varchar(255)"`
AssigneeId int
AssigneeName string `gorm:"type:varchar(255)"`
LeadTimeMinutes *uint
Url string `gorm:"type:varchar(255)"`
ClosedAt *time.Time
GitlabCreatedAt time.Time
GitlabUpdatedAt time.Time `gorm:"index"`
Severity string `gorm:"type:varchar(255)"`
Component string `gorm:"type:varchar(255)"`
TimeEstimate *int64
TotalTimeSpent *int64
common.NoPKModel
}
func (GitlabIssue) TableName ¶
func (GitlabIssue) TableName() string
type GitlabIssueAssignee ¶
type GitlabIssueAssignee struct {
common.NoPKModel
ConnectionId uint64 `gorm:"primaryKey"`
GitlabId int `gorm:"primaryKey"`
ProjectId int `gorm:"primaryKey"`
AssigneeId int `gorm:"primaryKey"`
AssigneeName string `gorm:"type:varchar(255)"`
}
func (GitlabIssueAssignee) TableName ¶
func (GitlabIssueAssignee) TableName() string
type GitlabIssueLabel ¶
type GitlabIssueLabel struct {
ConnectionId uint64 `gorm:"primaryKey"`
IssueId int `gorm:"primaryKey;autoIncrement:false"`
LabelName string `gorm:"primaryKey;type:varchar(255)"`
common.NoPKModel
}
func (GitlabIssueLabel) TableName ¶
func (GitlabIssueLabel) TableName() string
type GitlabJob ¶
type GitlabJob struct {
ConnectionId uint64 `gorm:"primaryKey"`
GitlabId int `gorm:"primaryKey"`
ProjectId int `gorm:"index"`
PipelineId int `gorm:"index"`
Status string `gorm:"type:varchar(255)"`
Stage string `gorm:"type:varchar(255)"`
Name string `gorm:"type:varchar(255)"`
Ref string `gorm:"type:varchar(255)"`
Tag bool `gorm:"type:boolean"`
AllowFailure bool `json:"allow_failure"`
Duration float64 `gorm:"type:float8"`
WebUrl string `gorm:"type:varchar(255)"`
QueuedDuration float64
GitlabCreatedAt *time.Time
StartedAt *time.Time
FinishedAt *time.Time
common.NoPKModel
}
type GitlabMember ¶
type GitlabMember struct {
AccessLevel int `json:"access_level"`
CreatedAt string `json:"created_at"`
CreatedBy GitlabUser `json:"created_by"`
ExpiresAt string `json:"expires_at"`
ID int `json:"id"`
Username string `json:"username"`
Name string `json:"name"`
State string `json:"state"`
AvatarURL string `json:"avatar_url"`
WebURL string `json:"web_url"`
MembershipState string `json:"membership_state"`
}
type GitlabMergeRequest ¶
type GitlabMergeRequest struct {
ConnectionId uint64 `gorm:"primaryKey"`
GitlabId int `gorm:"primaryKey"`
Iid int `gorm:"index"`
ProjectId int `gorm:"index"`
SourceProjectId int
TargetProjectId int
State string `gorm:"type:varchar(255)"`
Title string
WebUrl string `gorm:"type:varchar(255)"`
UserNotesCount int
WorkInProgress bool
IsDetailRequired bool
SourceBranch string `gorm:"type:varchar(255)"`
TargetBranch string `gorm:"type:varchar(255)"`
MergeCommitSha string `gorm:"type:varchar(255)"`
SquashCommitSha string `gorm:"type:varchar(255)"`
DiffHeadSha string `gorm:"type:varchar(255)"`
MergedAt *time.Time
GitlabCreatedAt time.Time
GitlabUpdatedAt *time.Time
ClosedAt *time.Time
Type string `gorm:"type:varchar(255)"`
MergedByUsername string `gorm:"type:varchar(255)"`
Description string
AuthorUsername string `gorm:"type:varchar(255)"`
AuthorUserId int
Component string `gorm:"type:varchar(255)"`
FirstCommentTime *time.Time `gorm:"comment:Time when the first comment occurred"`
ReviewRounds int `gorm:"comment:How many rounds of review this MR went through"`
common.NoPKModel
}
func (GitlabMergeRequest) TableName ¶
func (GitlabMergeRequest) TableName() string
type GitlabMrComment ¶
type GitlabMrComment struct {
ConnectionId uint64 `gorm:"primaryKey"`
GitlabId int `gorm:"primaryKey"`
MergeRequestId int `gorm:"index"`
MergeRequestIid int `gorm:"comment:Used in API requests ex. /api/merge_requests/<THIS_IID>"`
Body string
AuthorUsername string `gorm:"type:varchar(255)"`
AuthorUserId int
GitlabCreatedAt time.Time
Resolvable bool `gorm:"comment:Is or is not review comment"`
Type string `gorm:"comment:if type=null, it is normal comment,if type=diffNote,it is diff comment"`
common.NoPKModel
}
func (GitlabMrComment) TableName ¶
func (GitlabMrComment) TableName() string
type GitlabMrCommit ¶
type GitlabMrCommit struct {
ConnectionId uint64 `gorm:"primaryKey"`
CommitSha string `gorm:"primaryKey;type:varchar(40)"`
MergeRequestId int `gorm:"primaryKey;autoIncrement:false"`
CommitAuthorName string `gorm:"type:varchar(255)"` // Author name
CommitAuthorEmail string `gorm:"type:varchar(255)"` // Author email
CommitAuthoredDate *time.Time
common.NoPKModel
}
func (GitlabMrCommit) TableName ¶
func (GitlabMrCommit) TableName() string
type GitlabMrLabel ¶
type GitlabMrLabel struct {
ConnectionId uint64 `gorm:"primaryKey"`
MrId int `gorm:"primaryKey;autoIncrement:false"`
LabelName string `gorm:"primaryKey;type:varchar(255)"`
common.NoPKModel
}
func (GitlabMrLabel) TableName ¶
func (GitlabMrLabel) TableName() string
type GitlabMrNote ¶
type GitlabMrNote struct {
ConnectionId uint64 `gorm:"primaryKey"`
GitlabId int `gorm:"primaryKey"`
MergeRequestId int `gorm:"index"`
MergeRequestIid int `gorm:"comment:Used in API requests ex. /api/merge_requests/<THIS_IID>"`
NoteableType string `gorm:"type:varchar(100)"`
AuthorUserId int
AuthorUsername string `gorm:"type:varchar(255)"`
Body string
GitlabCreatedAt time.Time
Confidential bool
Resolvable bool `gorm:"comment:Is or is not review comment"`
IsSystem bool `gorm:"comment:Is or is not auto-generated vs. human generated"`
Type string `gorm:"comment:if type=null, it is normal comment,if type=diffNote,it is diff comment"`
common.NoPKModel
}
func (GitlabMrNote) TableName ¶
func (GitlabMrNote) TableName() string
type GitlabPipeline ¶
type GitlabPipeline struct {
ConnectionId uint64 `gorm:"primaryKey"`
GitlabId int `gorm:"primaryKey"`
ProjectId int `gorm:"index"`
Status string `gorm:"type:varchar(100)"`
Ref string `gorm:"type:varchar(255)"`
Sha string `gorm:"type:varchar(255)"`
WebUrl string `gorm:"type:varchar(255)"`
Duration int
QueuedDuration *float64
GitlabCreatedAt *time.Time
GitlabUpdatedAt *time.Time
StartedAt *time.Time
FinishedAt *time.Time
Coverage string
Type string `gorm:"type:varchar(255)"`
Environment string `gorm:"type:varchar(255)"`
IsDetailRequired bool
common.NoPKModel
}
func (GitlabPipeline) TableName ¶
func (GitlabPipeline) TableName() string
type GitlabPipelineProject ¶
type GitlabPipelineProject struct {
ConnectionId uint64 `gorm:"primaryKey"`
PipelineId int `gorm:"primaryKey"`
ProjectId int `gorm:"primaryKey"`
Ref string `gorm:"type:varchar(255)"`
Sha string `gorm:"type:varchar(255)"`
GitlabCreatedAt *time.Time
GitlabUpdatedAt *time.Time
common.NoPKModel
}
func (GitlabPipelineProject) TableName ¶
func (GitlabPipelineProject) TableName() string
type GitlabProject ¶
type GitlabProject struct {
common.Scope `mapstructure:",squash" gorm:"embedded"`
GitlabId int `json:"gitlabId" mapstructure:"gitlabId" validate:"required" gorm:"primaryKey"`
Name string `json:"name" mapstructure:"name" gorm:"type:varchar(255)"`
Description string `json:"description" mapstructure:"description"`
DefaultBranch string `json:"defaultBranch" mapstructure:"defaultBranch" gorm:"type:varchar(255)"`
PathWithNamespace string `json:"pathWithNamespace" mapstructure:"pathWithNamespace" gorm:"type:varchar(255)"`
WebUrl string `json:"webUrl" mapstructure:"webUrl" gorm:"type:varchar(255)"`
CreatorId int `json:"creatorId" mapstructure:"creatorId"`
Visibility string `json:"visibility" mapstructure:"visibility" gorm:"type:varchar(255)"`
OpenIssuesCount int `json:"openIssuesCount" mapstructure:"openIssuesCount"`
StarCount int `json:"starCount" mapstructure:"StarCount"`
ForkedFromProjectId int `json:"forkedFromProjectId" mapstructure:"forkedFromProjectId"`
ForkedFromProjectWebUrl string `json:"forkedFromProjectWebUrl" mapstructure:"forkedFromProjectWebUrl" gorm:"type:varchar(255)"`
HttpUrlToRepo string `json:"httpUrlToRepo" gorm:"type:varchar(255)"`
CreatedDate *time.Time `json:"createdDate" mapstructure:"-"`
UpdatedDate *time.Time `json:"updatedDate" mapstructure:"-"`
Archived bool `json:"archived" mapstructure:"archived"`
}
func (GitlabProject) ScopeFullName ¶
func (p GitlabProject) ScopeFullName() string
func (GitlabProject) ScopeId ¶
func (p GitlabProject) ScopeId() string
func (GitlabProject) ScopeName ¶
func (p GitlabProject) ScopeName() string
func (GitlabProject) ScopeParams ¶
func (p GitlabProject) ScopeParams() interface{}
func (GitlabProject) TableName ¶
func (GitlabProject) TableName() string
type GitlabProjectCommit ¶
type GitlabProjectCommit struct {
ConnectionId uint64 `gorm:"primaryKey"`
GitlabProjectId int `gorm:"primaryKey"`
CommitSha string `gorm:"primaryKey;type:varchar(40)"`
common.NoPKModel
}
func (GitlabProjectCommit) TableName ¶
func (GitlabProjectCommit) TableName() string
type GitlabResponse ¶
type GitlabResponse struct {
Name string `json:"name"`
ID int `json:"id"`
GitlabConnection
}
This object conforms to what the frontend currently expects.
type GitlabReviewer ¶
type GitlabReviewer struct {
ConnectionId uint64 `gorm:"primaryKey"`
GitlabId int `gorm:"primaryKey"`
MergeRequestId int `gorm:"index"`
ProjectId int `gorm:"index"`
Name string `gorm:"type:varchar(255)"`
Username string `gorm:"type:varchar(255)"`
State string `gorm:"type:varchar(255)"`
AvatarUrl string `gorm:"type:varchar(255)"`
WebUrl string `gorm:"type:varchar(255)"`
common.NoPKModel
}
func (GitlabReviewer) TableName ¶
func (GitlabReviewer) TableName() string
type GitlabScopeConfig ¶
type GitlabScopeConfig struct {
common.ScopeConfig `mapstructure:",squash" json:",inline" gorm:"embedded"`
PrType string `mapstructure:"prType" json:"prType"`
PrComponent string `mapstructure:"prComponent" json:"prComponent"`
PrBodyClosePattern string `mapstructure:"prBodyClosePattern" json:"prBodyClosePattern"`
IssueSeverity string `mapstructure:"issueSeverity" json:"issueSeverity"`
IssuePriority string `mapstructure:"issuePriority" json:"issuePriority"`
IssueComponent string `mapstructure:"issueComponent" json:"issueComponent"`
IssueTypeBug string `mapstructure:"issueTypeBug" json:"issueTypeBug"`
IssueTypeIncident string `mapstructure:"issueTypeIncident" json:"issueTypeIncident"`
IssueTypeRequirement string `mapstructure:"issueTypeRequirement" json:"issueTypeRequirement"`
DeploymentPattern string `mapstructure:"deploymentPattern" json:"deploymentPattern"`
ProductionPattern string `mapstructure:"productionPattern,omitempty" json:"productionPattern" gorm:"type:varchar(255)"`
EnvNamePattern string `mapstructure:"envNamePattern,omitempty" json:"envNamePattern" gorm:"type:varchar(255)"`
Refdiff datatypes.JSONMap `mapstructure:"refdiff,omitempty" json:"refdiff" swaggertype:"object" format:"json"`
}
func (GitlabScopeConfig) TableName ¶
func (t GitlabScopeConfig) TableName() string
type GitlabTag ¶
type GitlabUser ¶
type GroupAccess ¶
type GroupResponse ¶
type Permissions ¶
type Permissions struct {
ProjectAccess *ProjectAccess `json:"project_access"`
GroupAccess *GroupAccess `json:"group_access"`
}
type ProjectAccess ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.