Documentation
¶
Index ¶
- Constants
- type BitbucketAccount
- type BitbucketApiParams
- type BitbucketApiRepo
- type BitbucketCommit
- type BitbucketConn
- type BitbucketConnection
- type BitbucketDeployment
- type BitbucketIssue
- type BitbucketIssueComment
- type BitbucketPipeline
- type BitbucketPipelineStep
- type BitbucketPrComment
- type BitbucketPrCommit
- type BitbucketPullRequest
- type BitbucketRepo
- type BitbucketRepoCommit
- type BitbucketScopeConfig
- type GroupResponse
- type ReposResponse
- type WorkspaceItem
- type WorkspaceResponse
Constants ¶
View Source
const ( // https://github.com/juan-carlos-duarte/bitbucket-api-client-lib/blob/main/docs/PipelineState.md // https://community.atlassian.com/t5/Bitbucket-questions/Possible-value-for-status-filtering-in-API-pipelines/qaq-p/1755200 // https://github.com/juan-carlos-duarte/bitbucket-api-client-lib/blob/main/docs/PipelineState.md // https://developer.atlassian.com/server/bitbucket/rest/v815/api-group-builds-and-deployments/#api-api-latest-projects-projectkey-repos-repositoryslug-commits-commitid-deployments-get // https://github.com/juan-carlos-duarte/bitbucket-api-client-lib/blob/main/docs/DeploymentStateCompleted.md FAILED = "FAILED" ERROR = "ERROR" UNDEPLOYED = "UNDEPLOYED" STOPPED = "STOPPED" SKIPPED = "SKIPPED" SUCCESSFUL = "SUCCESSFUL" COMPLETED = "COMPLETED" PAUSED = "PAUSED" HALTED = "HALTED" IN_PROGRESS = "IN_PROGRESS" PENDING = "PENDING" BUILDING = "BUILDING" EXPIRED = "EXPIRED" RUNNING = "RUNNING" READY = "READY" PASSED = "PASSED" NOT_RUN = "NOT_RUN" CANCELLED = "CANCELLED" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitbucketAccount ¶
type BitbucketAccount struct {
ConnectionId uint64 `gorm:"primaryKey"`
AccountId string `gorm:"primaryKey;type:varchar(255)"`
UserName string `gorm:"type:varchar(255)"`
AccountStatus string `gorm:"type:varchar(255)"`
DisplayName string `gorm:"type:varchar(255)"`
AvatarUrl string `gorm:"type:varchar(255)"`
HtmlUrl string `gorm:"type:varchar(255)"`
Uuid string `gorm:"type:varchar(255)"`
Has2FaEnabled bool
common.NoPKModel
}
func (BitbucketAccount) TableName ¶
func (BitbucketAccount) TableName() string
type BitbucketApiParams ¶
type BitbucketApiRepo ¶
type BitbucketApiRepo struct {
//Scm string `json:"scm"`
//HasWiki bool `json:"has_wiki"`
//Uuid string `json:"uuid"`
//Type string `json:"type"`
//HasIssue bool `json:"has_issue"`
//ForkPolicy string `json:"fork_policy"`
Name string `json:"name"`
FullName string `json:"full_name"`
Language string `json:"language"`
Description string `json:"description"`
Owner struct {
Displayname string `json:"display_name"`
} `json:"owner"`
CreatedAt *time.Time `json:"created_on"`
UpdatedAt *time.Time `json:"updated_on"`
Links struct {
Clone []struct {
Href string `json:"href"`
Name string `json:"name"`
} `json:"clone"`
Html struct {
Href string `json:"href"`
} `json:"html"`
} `json:"links"`
}
func (BitbucketApiRepo) ConvertApiScope ¶
func (b BitbucketApiRepo) ConvertApiScope() *BitbucketRepo
type BitbucketCommit ¶
type BitbucketCommit struct {
Sha string `gorm:"primaryKey;type:varchar(40)"`
AuthorId string `gorm:"type:varchar(255)"`
AuthorName string `gorm:"type:varchar(255)"`
AuthorEmail string `gorm:"type:varchar(255)"`
AuthoredDate time.Time
CommittedDate time.Time
Message string
Url string `gorm:"type:varchar(255)"`
Additions int `gorm:"comment:Added lines of code"`
Deletions int `gorm:"comment:Deleted lines of code"`
common.NoPKModel
}
func (BitbucketCommit) TableName ¶
func (BitbucketCommit) TableName() string
type BitbucketConn ¶
type BitbucketConn struct {
api.RestConnection `mapstructure:",squash"`
api.BasicAuth `mapstructure:",squash"`
}
BitbucketConn holds the essential information to connect to the Bitbucket API
func (BitbucketConn) Sanitize ¶
func (connection BitbucketConn) Sanitize() BitbucketConn
type BitbucketConnection ¶
type BitbucketConnection struct {
api.BaseConnection `mapstructure:",squash"`
BitbucketConn `mapstructure:",squash"`
}
BitbucketConnection holds BitbucketConn plus ID/Name for database storage
func (*BitbucketConnection) MergeFromRequest ¶
func (connection *BitbucketConnection) MergeFromRequest(target *BitbucketConnection, body map[string]interface{}) error
func (BitbucketConnection) Sanitize ¶
func (connection BitbucketConnection) Sanitize() BitbucketConnection
func (BitbucketConnection) TableName ¶
func (BitbucketConnection) TableName() string
type BitbucketDeployment ¶
type BitbucketDeployment struct {
ConnectionId uint64 `gorm:"primaryKey"`
BitbucketId string `gorm:"primaryKey"`
PipelineId string `gorm:"type:varchar(255)"`
StepId string `gorm:"type:varchar(255)"`
Type string `gorm:"type:varchar(255)"`
Name string `gorm:"type:varchar(255)"`
Environment string `gorm:"type:varchar(255)"`
EnvironmentType string `gorm:"type:varchar(255)"`
Key string `gorm:"type:varchar(255)"`
WebUrl string `gorm:"type:varchar(255)"`
Status string `gorm:"type:varchar(100)"`
StateUrl string `gorm:"type:varchar(255)"`
CommitSha string `gorm:"type:varchar(255)"`
CommitUrl string `gorm:"type:varchar(255)"`
CreatedOn *time.Time
StartedOn *time.Time
CompletedOn *time.Time
LastUpdateTime *time.Time
common.NoPKModel
}
func (BitbucketDeployment) TableName ¶
func (BitbucketDeployment) TableName() string
type BitbucketIssue ¶
type BitbucketIssue struct {
ConnectionId uint64 `gorm:"primaryKey"`
RepoId string `gorm:"primaryKey;type:varchar(255)"`
BitbucketId int `gorm:"primaryKey"`
Number int `gorm:"index;comment:Used in API requests ex. api/issues/<THIS_NUMBER>"`
State string `gorm:"type:varchar(255)"`
StdState string `gorm:"type:varchar(255)"`
Title string `gorm:"type:varchar(255)"`
Body string
Priority string `gorm:"type:varchar(255)"`
Type string `gorm:"type:varchar(100)"`
AuthorId string `gorm:"type:varchar(255)"`
AuthorName string `gorm:"type:varchar(255)"`
AssigneeId string `gorm:"type:varchar(255)"`
AssigneeName string `gorm:"type:varchar(255)"`
MilestoneId int `gorm:"index"`
LeadTimeMinutes *uint
Url string `gorm:"type:varchar(255)"`
ClosedAt *time.Time
BitbucketCreatedAt time.Time
BitbucketUpdatedAt time.Time `gorm:"index"`
Severity string `gorm:"type:varchar(255)"`
Component string `gorm:"type:varchar(255)"`
common.NoPKModel
}
func (BitbucketIssue) TableName ¶
func (BitbucketIssue) TableName() string
type BitbucketIssueComment ¶
type BitbucketIssueComment struct {
ConnectionId uint64 `gorm:"primaryKey"`
BitbucketId int `gorm:"primaryKey"`
IssueId int `gorm:"index;comment:References the Issue"`
AuthorName string `gorm:"type:varchar(255)"`
AuthorId string `gorm:"type:varchar(255)"`
BitbucketCreatedAt time.Time
BitbucketUpdatedAt *time.Time
Type string
Body string
common.NoPKModel
}
func (BitbucketIssueComment) TableName ¶
func (BitbucketIssueComment) TableName() string
type BitbucketPipeline ¶
type BitbucketPipeline struct {
ConnectionId uint64 `gorm:"primaryKey"`
BitbucketId string `gorm:"primaryKey"`
Status string `gorm:"type:varchar(100)"`
Result string `gorm:"type:varchar(100)"`
RefName string `gorm:"type:varchar(255)"`
RepoId string `gorm:"type:varchar(255)"`
CommitSha string `gorm:"type:varchar(255)"`
WebUrl string `gorm:"type:varchar(255)"`
Type string `gorm:"type:varchar(255)"`
Environment string `gorm:"type:varchar(255)"`
BuildNumber int
DurationInSeconds uint64
BitbucketCreatedOn *time.Time
BitbucketCompleteOn *time.Time
common.NoPKModel
}
func (BitbucketPipeline) TableName ¶
func (BitbucketPipeline) TableName() string
type BitbucketPipelineStep ¶
type BitbucketPipelineStep struct {
ConnectionId uint64 `gorm:"primaryKey"`
BitbucketId string `gorm:"primaryKey"`
PipelineId string `gorm:"type:varchar(255)"`
Name string `gorm:"type:varchar(255)"`
Trigger string `gorm:"type:varchar(255)"`
State string `gorm:"type:varchar(255)"`
Result string `gorm:"type:varchar(255)"`
RepoId string `gorm:"type:varchar(255)"`
MaxTime int
StartedOn *time.Time
CompletedOn *time.Time
DurationInSeconds int
BuildSecondsUsed int
RunNumber int
Type string `gorm:"type:varchar(255)"`
Environment string `gorm:"type:varchar(255)"`
common.NoPKModel
}
func (BitbucketPipelineStep) TableName ¶
func (BitbucketPipelineStep) TableName() string
type BitbucketPrComment ¶
type BitbucketPrComment struct {
ConnectionId uint64 `gorm:"primaryKey"`
BitbucketId int `gorm:"primaryKey"`
RepoId string `gorm:"index:pr"` // PullRequestId is not unique across multiple repos of a connection
PullRequestId int `gorm:"index:pr"`
AuthorId string `gorm:"type:varchar(255)"`
AuthorName string `gorm:"type:varchar(255)"`
BitbucketCreatedAt time.Time
BitbucketUpdatedAt *time.Time
Type string `gorm:"comment:if type=null, it is normal comment,if type=diffNote,it is diff comment"`
Body string
common.NoPKModel
}
func (BitbucketPrComment) TableName ¶
func (BitbucketPrComment) TableName() string
type BitbucketPrCommit ¶
type BitbucketPrCommit struct {
ConnectionId uint64 `gorm:"primaryKey"`
RepoId string `gorm:"primaryKey"` // PullRequestId is not unique across multiple repos of a connection
PullRequestId int `gorm:"primaryKey;autoIncrement:false"`
CommitSha string `gorm:"primaryKey;type:varchar(40)"`
CommitAuthorName string
CommitAuthorEmail string
CommitAuthoredDate time.Time
common.NoPKModel
}
func (BitbucketPrCommit) TableName ¶
func (BitbucketPrCommit) TableName() string
type BitbucketPullRequest ¶
type BitbucketPullRequest struct {
ConnectionId uint64 `gorm:"primaryKey"`
RepoId string `gorm:"primaryKey;type:varchar(255)"`
BitbucketId int `gorm:"primaryKey"`
Number int `gorm:"index"` // This number is used in GET requests to the API associated to reviewers / comments / etc.
BaseRepoId string
HeadRepoId string
State string `gorm:"type:varchar(255)"`
Title string
Description string
BitbucketCreatedAt time.Time
BitbucketUpdatedAt time.Time `gorm:"index"`
ClosedAt *time.Time
CommentCount int
Commits int
MergedAt *time.Time
Body string
Type string `gorm:"type:varchar(255)"`
Component string `gorm:"type:varchar(255)"`
MergeCommitSha string `gorm:"type:varchar(40)"`
HeadRef string `gorm:"type:varchar(255)"`
BaseRef string `gorm:"type:varchar(255)"`
BaseCommitSha string `gorm:"type:varchar(255)"`
HeadCommitSha string `gorm:"type:varchar(255)"`
Url string `gorm:"type:varchar(255)"`
AuthorName string `gorm:"type:varchar(255)"`
AuthorId string `gorm:"type:varchar(255)"`
common.NoPKModel
}
func (BitbucketPullRequest) TableName ¶
func (BitbucketPullRequest) TableName() string
type BitbucketRepo ¶
type BitbucketRepo struct {
common.Scope `mapstructure:",squash"`
BitbucketId string `json:"bitbucketId" gorm:"primaryKey;type:varchar(255)" validate:"required" mapstructure:"bitbucketId"`
Name string `json:"name" gorm:"type:varchar(255)" mapstructure:"name,omitempty"`
HTMLUrl string `json:"HTMLUrl" gorm:"type:varchar(255)" mapstructure:"HTMLUrl,omitempty"`
Description string `json:"description" mapstructure:"description,omitempty"`
Owner string `json:"owner" mapstructure:"owner,omitempty"`
Language string `json:"language" gorm:"type:varchar(255)" mapstructure:"language,omitempty"`
CloneUrl string `json:"cloneUrl" gorm:"type:varchar(255)" mapstructure:"cloneUrl,omitempty"`
CreatedDate *time.Time `json:"createdDate" mapstructure:"-"`
UpdatedDate *time.Time `json:"updatedDate" mapstructure:"-"`
}
func (BitbucketRepo) ScopeFullName ¶
func (p BitbucketRepo) ScopeFullName() string
func (BitbucketRepo) ScopeId ¶
func (p BitbucketRepo) ScopeId() string
func (BitbucketRepo) ScopeName ¶
func (p BitbucketRepo) ScopeName() string
func (BitbucketRepo) ScopeParams ¶
func (p BitbucketRepo) ScopeParams() interface{}
func (BitbucketRepo) TableName ¶
func (BitbucketRepo) TableName() string
type BitbucketRepoCommit ¶
type BitbucketRepoCommit struct {
ConnectionId uint64 `gorm:"primaryKey"`
RepoId string `gorm:"primaryKey;type:varchar(255)"`
CommitSha string `gorm:"primaryKey;type:varchar(40)"`
common.NoPKModel
}
func (BitbucketRepoCommit) TableName ¶
func (BitbucketRepoCommit) TableName() string
type BitbucketScopeConfig ¶
type BitbucketScopeConfig struct {
common.ScopeConfig `mapstructure:",squash" json:",inline" gorm:"embedded"`
DeploymentPattern string `mapstructure:"deploymentPattern,omitempty" json:"deploymentPattern" gorm:"type:varchar(255)"`
ProductionPattern string `mapstructure:"productionPattern,omitempty" json:"productionPattern" gorm:"type:varchar(255)"`
Refdiff datatypes.JSONMap `mapstructure:"refdiff,omitempty" json:"refdiff" swaggertype:"object" format:"json"`
// a string array, split by `,`.
IssueStatusTodo string `mapstructure:"issueStatusTodo,omitempty" json:"issueStatusTodo" gorm:"type:varchar(255)"`
IssueStatusInProgress string `mapstructure:"issueStatusInProgress,omitempty" json:"issueStatusInProgress" gorm:"type:varchar(255)"`
IssueStatusDone string `mapstructure:"issueStatusDone,omitempty" json:"issueStatusDone" gorm:"type:varchar(255)"`
IssueStatusOther string `mapstructure:"issueStatusOther,omitempty" json:"issueStatusOther" gorm:"type:varchar(255)"`
}
func (*BitbucketScopeConfig) SetConnectionId ¶
func (cfg *BitbucketScopeConfig) SetConnectionId(c *BitbucketScopeConfig, connectionId uint64)
func (BitbucketScopeConfig) TableName ¶
func (BitbucketScopeConfig) TableName() string
type GroupResponse ¶
type GroupResponse struct {
//Type string `json:"type"`
//Permission string `json:"permission"`
//LastAccessed time.Time `json:"last_accessed"`
//AddedOn time.Time `json:"added_on"`
Workspace WorkspaceItem `json:"workspace"`
}
func (GroupResponse) GroupId ¶
func (p GroupResponse) GroupId() string
func (GroupResponse) GroupName ¶
func (p GroupResponse) GroupName() string
type ReposResponse ¶
type ReposResponse struct {
Pagelen int `json:"pagelen"`
Page int `json:"page"`
Size int `json:"size"`
Values []BitbucketApiRepo `json:"values"`
}
type WorkspaceItem ¶
type WorkspaceResponse ¶
type WorkspaceResponse struct {
Pagelen int `json:"pagelen"`
Page int `json:"page"`
Size int `json:"size"`
Values []GroupResponse `json:"values"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.