Documentation
¶
Index ¶
- func FormatTime(t string) string
- type Branch
- type Clone
- type Comment
- type Commit
- type ID
- type InlineRef
- type Link
- type Links
- type PREndpoint
- type Participant
- type Pipeline
- type PipelineState
- type PipelineStateValue
- type PipelineStep
- type PipelineTarget
- type Project
- type PullRequest
- type Repository
- type User
- type Workspace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatTime ¶
FormatTime formats a Bitbucket timestamp for display.
Types ¶
type Branch ¶
type Branch struct {
Name string `json:"name"`
}
Branch represents a branch reference.
type Comment ¶
type Comment struct {
ID int `json:"id"`
Parent *ID `json:"parent,omitempty"`
Deleted bool `json:"deleted"`
Content struct {
Raw string `json:"raw"`
Markup string `json:"markup"`
HTML string `json:"html"`
} `json:"content"`
Inline *InlineRef `json:"inline,omitempty"`
Author User `json:"user"`
CreatedOn string `json:"created_on"`
UpdatedOn string `json:"updated_on"`
Links Links `json:"links"`
}
Comment represents a pull request comment.
type Commit ¶
type Commit struct {
Hash string `json:"hash"`
Message string `json:"message"`
Date string `json:"date"`
Author *User `json:"author"`
}
Commit represents a commit reference.
type InlineRef ¶
type InlineRef struct {
Path string `json:"path"`
From *int `json:"from,omitempty"` // old line
To *int `json:"to,omitempty"` // new line
}
InlineRef marks a comment as inline on a specific file/line.
type Links ¶
type Links struct {
Self *Link `json:"self,omitempty"`
HTML *Link `json:"html,omitempty"`
Clone []Clone `json:"clone,omitempty"`
Avatar *Link `json:"avatar,omitempty"`
}
Links holds common link structures.
type PREndpoint ¶
type PREndpoint struct {
Branch Branch `json:"branch"`
Commit Commit `json:"commit"`
Repository *Repository `json:"repository"`
}
PREndpoint represents a source or destination branch endpoint.
type Participant ¶
type Participant struct {
User User `json:"user"`
Role string `json:"role"` // "REVIEWER", "PARTICIPANT"
Approved bool `json:"approved"`
State string `json:"state"` // "approved", "changes_requested", etc.
}
Participant represents a PR participant.
type Pipeline ¶
type Pipeline struct {
UUID string `json:"uuid"`
BuildNumber int `json:"build_number"`
State *PipelineState `json:"state"`
Target PipelineTarget `json:"target"`
CreatedOn string `json:"created_on"`
CompletedOn string `json:"completed_on"`
Creator User `json:"creator"`
Links Links `json:"links"`
}
Pipeline represents a Bitbucket pipeline.
func (*Pipeline) StatusText ¶
StatusText returns a human-readable status string for a pipeline.
type PipelineState ¶
type PipelineState struct {
Name string `json:"name"` // PENDING, IN_PROGRESS, COMPLETED, etc.
Result *PipelineStateValue `json:"result,omitempty"`
Stage *PipelineStateValue `json:"stage,omitempty"`
}
PipelineState represents the pipeline state.
type PipelineStateValue ¶
type PipelineStateValue struct {
Name string `json:"name"` // SUCCESSFUL, FAILED, STOPPED, etc.
}
PipelineStateValue holds a state result or stage name.
type PipelineStep ¶
type PipelineStep struct {
UUID string `json:"uuid"`
Name string `json:"name"`
State *PipelineState `json:"state"`
StartedOn string `json:"started_on"`
CompletedOn string `json:"completed_on"`
LogLink string `json:"-"` // Computed from links
Links Links `json:"links"`
}
PipelineStep represents a step in a pipeline.
type PipelineTarget ¶
type PipelineTarget struct {
Type string `json:"type"` // pipeline_ref_target, pipeline_custom_target
RefType string `json:"ref_type"`
RefName string `json:"ref_name"`
Selector *struct {
Type string `json:"type"`
Pattern string `json:"pattern"`
} `json:"selector,omitempty"`
Commit Commit `json:"commit"`
}
PipelineTarget represents what triggered the pipeline.
type PullRequest ¶
type PullRequest struct {
ID int `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
State string `json:"state"` // OPEN, MERGED, DECLINED, SUPERSEDED
CreatedOn string `json:"created_on"`
UpdatedOn string `json:"updated_on"`
Author User `json:"author"`
Source PREndpoint `json:"source"`
Destination PREndpoint `json:"destination"`
Draft bool `json:"draft"`
CloseSourceBranch bool `json:"close_source_branch"`
MergeCommit *Commit `json:"merge_commit"`
Reviewers []User `json:"reviewers"`
Participants []Participant `json:"participants"`
TaskCount int `json:"task_count"`
CommentCount int `json:"comment_count"`
Reason string `json:"reason"`
Links Links `json:"links"`
}
PullRequest represents a Bitbucket pull request.
type Repository ¶
type Repository struct {
UUID string `json:"uuid"`
Name string `json:"name"`
FullName string `json:"full_name"`
Slug string `json:"slug"`
Description string `json:"description"`
IsPrivate bool `json:"is_private"`
Language string `json:"language"`
CreatedOn string `json:"created_on"`
UpdatedOn string `json:"updated_on"`
Size int64 `json:"size"`
ForkPolicy string `json:"fork_policy"`
SCM string `json:"scm"`
Project *Project `json:"project"`
Owner *User `json:"owner"`
Workspace Workspace `json:"workspace"`
MainBranch *Branch `json:"mainbranch"`
Links Links `json:"links"`
}
Repository represents a Bitbucket repository.
func (*Repository) CloneURL ¶
func (r *Repository) CloneURL(protocol string) string
CloneURL returns the clone URL for the given protocol ("ssh" or "https").
func (*Repository) Visibility ¶
func (r *Repository) Visibility() string
Visibility returns "private" or "public".