package bitbucket
import "github.com/ktrysmt/go-bitbucket"
Index ¶
- Constants
- func DecodeError(e map[string]interface{}) error
- type BitbucketError
- type BranchModel
- type BranchRestrictions
- func (b *BranchRestrictions) Create(bo *BranchRestrictionsOptions) (interface{}, error)
- func (b *BranchRestrictions) Delete(bo *BranchRestrictionsOptions) (interface{}, error)
- func (b *BranchRestrictions) Get(bo *BranchRestrictionsOptions) (interface{}, error)
- func (b *BranchRestrictions) Gets(bo *BranchRestrictionsOptions) (interface{}, error)
- func (b *BranchRestrictions) Update(bo *BranchRestrictionsOptions) (interface{}, error)
- type BranchRestrictionsOptions
- type BranchType
- type BranchingModel
- type Client
- func NewBasicAuth(u, p string) *Client
- func NewOAuth(i, s string) *Client
- func NewOAuthClientCredentials(i, s string) *Client
- func NewOAuthWithCode(i, s, c string) (*Client, string)
- func NewOAuthbearerToken(t string) *Client
- func (c *Client) Get(t string) (interface{}, error)
- func (c *Client) GetApiBaseURL() string
- func (c *Client) SetApiBaseURL(urlStr string)
- type CommitStatusOptions
- type Commits
- func (cm *Commits) CreateCommitStatus(cmo *CommitsOptions, cso *CommitStatusOptions) (interface{}, error)
- func (cm *Commits) GetCommit(cmo *CommitsOptions) (interface{}, error)
- func (cm *Commits) GetCommitComment(cmo *CommitsOptions) (interface{}, error)
- func (cm *Commits) GetCommitComments(cmo *CommitsOptions) (interface{}, error)
- func (cm *Commits) GetCommitStatus(cmo *CommitsOptions, commitStatusKey string) (interface{}, error)
- func (cm *Commits) GetCommitStatuses(cmo *CommitsOptions) (interface{}, error)
- func (cm *Commits) GetCommits(cmo *CommitsOptions) (interface{}, error)
- func (cm *Commits) GiveApprove(cmo *CommitsOptions) (interface{}, error)
- func (cm *Commits) RemoveApprove(cmo *CommitsOptions) (interface{}, error)
- type CommitsOptions
- type Diff
- func (d *Diff) GetDiff(do *DiffOptions) (interface{}, error)
- func (d *Diff) GetPatch(do *DiffOptions) (interface{}, error)
- type DiffOptions
- type Downloads
- func (dl *Downloads) Create(do *DownloadsOptions) (interface{}, error)
- func (dl *Downloads) List(do *DownloadsOptions) (interface{}, error)
- type DownloadsOptions
- type PageRes
- type Pipeline
- type PipelineBuildNumber
- type PipelineKeyPair
- type PipelineVariable
- type Project
- type PullRequests
- func (p *PullRequests) Activities(po *PullRequestsOptions) (interface{}, error)
- func (p *PullRequests) Activity(po *PullRequestsOptions) (interface{}, error)
- func (p *PullRequests) Commits(po *PullRequestsOptions) (interface{}, error)
- func (p *PullRequests) Create(po *PullRequestsOptions) (interface{}, error)
- func (p *PullRequests) Decline(po *PullRequestsOptions) (interface{}, error)
- func (p *PullRequests) Diff(po *PullRequestsOptions) (interface{}, error)
- func (p *PullRequests) Get(po *PullRequestsOptions) (interface{}, error)
- func (p *PullRequests) GetComment(po *PullRequestsOptions) (interface{}, error)
- func (p *PullRequests) GetComments(po *PullRequestsOptions) (interface{}, error)
- func (p *PullRequests) Gets(po *PullRequestsOptions) (interface{}, error)
- func (p *PullRequests) Merge(po *PullRequestsOptions) (interface{}, error)
- func (p *PullRequests) Patch(po *PullRequestsOptions) (interface{}, error)
- func (p *PullRequests) Update(po *PullRequestsOptions) (interface{}, error)
- type PullRequestsOptions
- type Repositories
- func (r *Repositories) ListForAccount(ro *RepositoriesOptions) (*RepositoriesRes, error)
- func (r *Repositories) ListForTeam(ro *RepositoriesOptions) (*RepositoriesRes, error)
- func (r *Repositories) ListPublic() (interface{}, error)
- type RepositoriesOptions
- type RepositoriesRes
- type Repository
- func (r *Repository) AddPipelineKeyPair(rpkpo *RepositoryPipelineKeyPairOptions) (*PipelineKeyPair, error)
- func (r *Repository) AddPipelineVariable(rpvo *RepositoryPipelineVariableOptions) (*PipelineVariable, error)
- func (r *Repository) BranchingModel(rbmo *RepositoryBranchingModelOptions) (*BranchingModel, error)
- func (r *Repository) Create(ro *RepositoryOptions) (*Repository, error)
- func (r *Repository) Delete(ro *RepositoryOptions) (interface{}, error)
- func (r *Repository) Get(ro *RepositoryOptions) (*Repository, error)
- func (r *Repository) GetFileBlob(ro *RepositoryBlobOptions) (*RepositoryBlob, error)
- func (r *Repository) ListBranches(rbo *RepositoryBranchOptions) (*RepositoryBranches, error)
- func (r *Repository) ListFiles(ro *RepositoryFilesOptions) ([]RepositoryFile, error)
- func (r *Repository) ListForks(ro *RepositoryOptions) (interface{}, error)
- func (r *Repository) ListTags(rbo *RepositoryTagOptions) (*RepositoryTags, error)
- func (r *Repository) ListWatchers(ro *RepositoryOptions) (interface{}, error)
- func (r *Repository) UpdatePipelineBuildNumber(rpbno *RepositoryPipelineBuildNumberOptions) (*PipelineBuildNumber, error)
- func (r *Repository) UpdatePipelineConfig(rpo *RepositoryPipelineOptions) (*Pipeline, error)
- type RepositoryBlob
- type RepositoryBlobOptions
- type RepositoryBranch
- type RepositoryBranchOptions
- type RepositoryBranches
- type RepositoryBranchingModelOptions
- type RepositoryFile
- type RepositoryFilesOptions
- type RepositoryOptions
- type RepositoryPipelineBuildNumberOptions
- type RepositoryPipelineKeyPairOptions
- type RepositoryPipelineOptions
- type RepositoryPipelineVariableOptions
- type RepositoryTag
- type RepositoryTagOptions
- type RepositoryTags
- type Teams
- func (t *Teams) Followers(teamname string) (interface{}, error)
- func (t *Teams) Following(teamname string) (interface{}, error)
- func (t *Teams) List(role string) (interface{}, error)
- func (t *Teams) Members(teamname string) (interface{}, error)
- func (t *Teams) Profile(teamname string) (interface{}, error)
- func (t *Teams) Projects(teamname string) (interface{}, error)
- func (t *Teams) Repositories(teamname string) (interface{}, error)
- type User
- type Users
- func (u *Users) Followers(t string) (interface{}, error)
- func (u *Users) Following(t string) (interface{}, error)
- func (u *Users) Get(t string) (interface{}, error)
- func (u *Users) Repositories(t string) (interface{}, error)
- type Webhooks
- func (r *Webhooks) Create(ro *WebhooksOptions) (interface{}, error)
- func (r *Webhooks) Delete(ro *WebhooksOptions) (interface{}, error)
- func (r *Webhooks) Get(ro *WebhooksOptions) (interface{}, error)
- func (r *Webhooks) Gets(ro *WebhooksOptions) (interface{}, error)
- func (r *Webhooks) Update(ro *WebhooksOptions) (interface{}, error)
- type WebhooksOptions
Constants ¶
const DEFAULT_MAX_DEPTH = 1
const DEFAULT_PAGE_LENGTH = 10
Functions ¶
func DecodeError ¶
Types ¶
type BitbucketError ¶
type BranchModel ¶
type BranchModel struct { Name string Branch RepositoryBranch Use_Mainbranch bool }
type BranchRestrictions ¶
type BranchRestrictions struct {
// contains filtered or unexported fields
}
func (*BranchRestrictions) Create ¶
func (b *BranchRestrictions) Create(bo *BranchRestrictionsOptions) (interface{}, error)
func (*BranchRestrictions) Delete ¶
func (b *BranchRestrictions) Delete(bo *BranchRestrictionsOptions) (interface{}, error)
func (*BranchRestrictions) Get ¶
func (b *BranchRestrictions) Get(bo *BranchRestrictionsOptions) (interface{}, error)
func (*BranchRestrictions) Gets ¶
func (b *BranchRestrictions) Gets(bo *BranchRestrictionsOptions) (interface{}, error)
func (*BranchRestrictions) Update ¶
func (b *BranchRestrictions) Update(bo *BranchRestrictionsOptions) (interface{}, error)
type BranchRestrictionsOptions ¶
type BranchRestrictionsOptions struct { Owner string `json:"owner"` RepoSlug string `json:"repo_slug"` ID string `json:"id"` Groups map[string]string `json:"groups"` Pattern string `json:"pattern"` Users []string `json:"users"` Kind string `json:"kind"` FullSlug string `json:"full_slug"` Name string `json:"name"` Value interface{} `json:"value"` }
type BranchType ¶
type BranchingModel ¶
type BranchingModel struct { Type string Branch_Types []BranchType Development BranchModel Production BranchModel }
type Client ¶
type Client struct { Auth *auth Users users User user Teams teams Repositories *Repositories Pagelen uint64 MaxDepth uint64 HttpClient *http.Client // contains filtered or unexported fields }
func NewBasicAuth ¶
func NewOAuth ¶
func NewOAuthClientCredentials ¶
Uses the Client Credentials Grant oauth2 flow to authenticate to Bitbucket
func NewOAuthWithCode ¶
NewOAuthWithCode finishes the OAuth handshake with a given code and returns a *Client
func NewOAuthbearerToken ¶
func (*Client) Get ¶
func (*Client) GetApiBaseURL ¶
func (*Client) SetApiBaseURL ¶
type CommitStatusOptions ¶
type CommitStatusOptions struct { Key string `json:"key"` Url string `json:"url"` State string `json:"state"` Name string `json:"name"` Description string `json:"description"` }
type Commits ¶
type Commits struct {
// contains filtered or unexported fields
}
func (*Commits) CreateCommitStatus ¶
func (cm *Commits) CreateCommitStatus(cmo *CommitsOptions, cso *CommitStatusOptions) (interface{}, error)
func (*Commits) GetCommit ¶
func (cm *Commits) GetCommit(cmo *CommitsOptions) (interface{}, error)
func (*Commits) GetCommitComment ¶
func (cm *Commits) GetCommitComment(cmo *CommitsOptions) (interface{}, error)
func (*Commits) GetCommitComments ¶
func (cm *Commits) GetCommitComments(cmo *CommitsOptions) (interface{}, error)
func (*Commits) GetCommitStatus ¶
func (cm *Commits) GetCommitStatus(cmo *CommitsOptions, commitStatusKey string) (interface{}, error)
func (*Commits) GetCommitStatuses ¶
func (cm *Commits) GetCommitStatuses(cmo *CommitsOptions) (interface{}, error)
func (*Commits) GetCommits ¶
func (cm *Commits) GetCommits(cmo *CommitsOptions) (interface{}, error)
func (*Commits) GiveApprove ¶
func (cm *Commits) GiveApprove(cmo *CommitsOptions) (interface{}, error)
func (*Commits) RemoveApprove ¶
func (cm *Commits) RemoveApprove(cmo *CommitsOptions) (interface{}, error)
type CommitsOptions ¶
type CommitsOptions struct { Owner string `json:"owner"` RepoSlug string `json:"repo_slug"` Revision string `json:"revision"` Branchortag string `json:"branchortag"` Include string `json:"include"` Exclude string `json:"exclude"` CommentID string `json:"comment_id"` }
type Diff ¶
type Diff struct {
// contains filtered or unexported fields
}
func (*Diff) GetDiff ¶
func (d *Diff) GetDiff(do *DiffOptions) (interface{}, error)
func (*Diff) GetPatch ¶
func (d *Diff) GetPatch(do *DiffOptions) (interface{}, error)
type DiffOptions ¶
type DiffOptions struct { Owner string `json:"owner"` RepoSlug string `json:"repo_slug"` Spec string `json:"spec"` }
type Downloads ¶
type Downloads struct {
// contains filtered or unexported fields
}
func (*Downloads) Create ¶
func (dl *Downloads) Create(do *DownloadsOptions) (interface{}, error)
func (*Downloads) List ¶
func (dl *Downloads) List(do *DownloadsOptions) (interface{}, error)
type DownloadsOptions ¶
type DownloadsOptions struct { Owner string `json:"owner"` RepoSlug string `json:"repo_slug"` FilePath string `json:"filepath"` FileName string `json:"filename"` }
type PageRes ¶
type PageRes struct { Page int32 `json:"page"` PageLen int32 `json:"pagelen"` MaxDepth int32 `json:"max_depth"` Size int32 `json:"size"` }
type Pipeline ¶
type Pipeline struct { Type string Enabled bool Repository Repository }
type PipelineBuildNumber ¶
type PipelineKeyPair ¶
type PipelineVariable ¶
type Project ¶
type PullRequests ¶
type PullRequests struct {
// contains filtered or unexported fields
}
func (*PullRequests) Activities ¶
func (p *PullRequests) Activities(po *PullRequestsOptions) (interface{}, error)
func (*PullRequests) Activity ¶
func (p *PullRequests) Activity(po *PullRequestsOptions) (interface{}, error)
func (*PullRequests) Commits ¶
func (p *PullRequests) Commits(po *PullRequestsOptions) (interface{}, error)
func (*PullRequests) Create ¶
func (p *PullRequests) Create(po *PullRequestsOptions) (interface{}, error)
func (*PullRequests) Decline ¶
func (p *PullRequests) Decline(po *PullRequestsOptions) (interface{}, error)
func (*PullRequests) Diff ¶
func (p *PullRequests) Diff(po *PullRequestsOptions) (interface{}, error)
func (*PullRequests) Get ¶
func (p *PullRequests) Get(po *PullRequestsOptions) (interface{}, error)
func (*PullRequests) GetComment ¶
func (p *PullRequests) GetComment(po *PullRequestsOptions) (interface{}, error)
func (*PullRequests) GetComments ¶
func (p *PullRequests) GetComments(po *PullRequestsOptions) (interface{}, error)
func (*PullRequests) Gets ¶
func (p *PullRequests) Gets(po *PullRequestsOptions) (interface{}, error)
func (*PullRequests) Merge ¶
func (p *PullRequests) Merge(po *PullRequestsOptions) (interface{}, error)
func (*PullRequests) Patch ¶
func (p *PullRequests) Patch(po *PullRequestsOptions) (interface{}, error)
func (*PullRequests) Update ¶
func (p *PullRequests) Update(po *PullRequestsOptions) (interface{}, error)
type PullRequestsOptions ¶
type PullRequestsOptions struct { ID string `json:"id"` CommentID string `json:"comment_id"` Owner string `json:"owner"` RepoSlug string `json:"repo_slug"` Title string `json:"title"` Description string `json:"description"` CloseSourceBranch bool `json:"close_source_branch"` SourceBranch string `json:"source_branch"` SourceRepository string `json:"source_repository"` DestinationBranch string `json:"destination_branch"` DestinationCommit string `json:"destination_repository"` Message string `json:"message"` Reviewers []string `json:"reviewers"` States []string `json:"states"` Query string `json:"query"` Sort string `json:"sort"` }
type Repositories ¶
type Repositories struct { PullRequests *PullRequests Repository *Repository Commits *Commits Diff *Diff BranchRestrictions *BranchRestrictions Webhooks *Webhooks Downloads *Downloads // contains filtered or unexported fields }
func (*Repositories) ListForAccount ¶
func (r *Repositories) ListForAccount(ro *RepositoriesOptions) (*RepositoriesRes, error)
func (*Repositories) ListForTeam ¶
func (r *Repositories) ListForTeam(ro *RepositoriesOptions) (*RepositoriesRes, error)
func (*Repositories) ListPublic ¶
func (r *Repositories) ListPublic() (interface{}, error)
type RepositoriesOptions ¶
type RepositoriesOptions struct { Owner string `json:"owner"` Role string `json:"role"` // role=[owner|admin|contributor|member] }
type RepositoriesRes ¶
type RepositoriesRes struct { Page int32 Pagelen int32 MaxDepth int32 Size int32 Items []Repository }
type Repository ¶
type Repository struct { Project Project Slug string Full_name string Description string ForkPolicy string Type string Owner map[string]interface{} Links map[string]interface{} // contains filtered or unexported fields }
func (*Repository) AddPipelineKeyPair ¶
func (r *Repository) AddPipelineKeyPair(rpkpo *RepositoryPipelineKeyPairOptions) (*PipelineKeyPair, error)
func (*Repository) AddPipelineVariable ¶
func (r *Repository) AddPipelineVariable(rpvo *RepositoryPipelineVariableOptions) (*PipelineVariable, error)
func (*Repository) BranchingModel ¶
func (r *Repository) BranchingModel(rbmo *RepositoryBranchingModelOptions) (*BranchingModel, error)
func (*Repository) Create ¶
func (r *Repository) Create(ro *RepositoryOptions) (*Repository, error)
func (*Repository) Delete ¶
func (r *Repository) Delete(ro *RepositoryOptions) (interface{}, error)
func (*Repository) Get ¶
func (r *Repository) Get(ro *RepositoryOptions) (*Repository, error)
func (*Repository) GetFileBlob ¶
func (r *Repository) GetFileBlob(ro *RepositoryBlobOptions) (*RepositoryBlob, error)
func (*Repository) ListBranches ¶
func (r *Repository) ListBranches(rbo *RepositoryBranchOptions) (*RepositoryBranches, error)
func (*Repository) ListFiles ¶
func (r *Repository) ListFiles(ro *RepositoryFilesOptions) ([]RepositoryFile, error)
func (*Repository) ListForks ¶
func (r *Repository) ListForks(ro *RepositoryOptions) (interface{}, error)
func (*Repository) ListTags ¶
func (r *Repository) ListTags(rbo *RepositoryTagOptions) (*RepositoryTags, error)
func (*Repository) ListWatchers ¶
func (r *Repository) ListWatchers(ro *RepositoryOptions) (interface{}, error)
func (*Repository) UpdatePipelineBuildNumber ¶
func (r *Repository) UpdatePipelineBuildNumber(rpbno *RepositoryPipelineBuildNumberOptions) (*PipelineBuildNumber, error)
func (*Repository) UpdatePipelineConfig ¶
func (r *Repository) UpdatePipelineConfig(rpo *RepositoryPipelineOptions) (*Pipeline, error)
type RepositoryBlob ¶
type RepositoryBlob struct { Content []byte }
func (RepositoryBlob) String ¶
func (rb RepositoryBlob) String() string
type RepositoryBlobOptions ¶
type RepositoryBlobOptions struct { Owner string `json:"owner"` RepoSlug string `json:"repo_slug"` Ref string `json:"ref"` Path string `json:"path"` }
type RepositoryBranch ¶
type RepositoryBranch struct { Type string Name string Default_Merge_Strategy string Merge_Strategies []string Links map[string]interface{} Target map[string]interface{} Heads []map[string]interface{} }
type RepositoryBranchOptions ¶
type RepositoryBranchOptions struct { Owner string `json:"owner"` RepoSlug string `json:"repo_slug"` Query string `json:"q"` Sort string `json:"sort"` PageNum int `json:"page"` Pagelen int `json:"pagelen"` MaxDepth int `json:"max_depth"` }
type RepositoryBranches ¶
type RepositoryBranches struct { Page int Pagelen int MaxDepth int Size int Next string Branches []RepositoryBranch }
type RepositoryBranchingModelOptions ¶
type RepositoryBranchingModelOptions struct { Owner string `json:"owner"` RepoSlug string `json:"repo_slug"` }
type RepositoryFile ¶
type RepositoryFile struct { Mimetype string Links map[string]interface{} Path string Commit map[string]interface{} Attributes []string Type string Size int }
func (RepositoryFile) String ¶
func (rf RepositoryFile) String() string
type RepositoryFilesOptions ¶
type RepositoryFilesOptions struct { Owner string `json:"owner"` RepoSlug string `json:"repo_slug"` Ref string `json:"ref"` Path string `json:"path"` }
type RepositoryOptions ¶
type RepositoryOptions struct { Owner string `json:"owner"` RepoSlug string `json:"repo_slug"` Scm string `json:"scm"` // Name string `json:"name"` IsPrivate string `json:"is_private"` Description string `json:"description"` ForkPolicy string `json:"fork_policy"` Language string `json:"language"` HasIssues string `json:"has_issues"` HasWiki string `json:"has_wiki"` Project string `json:"project"` }
type RepositoryPipelineBuildNumberOptions ¶
type RepositoryPipelineBuildNumberOptions struct { Owner string `json:"owner"` RepoSlug string `json:"repo_slug"` Next int `json:"next"` }
type RepositoryPipelineKeyPairOptions ¶
type RepositoryPipelineKeyPairOptions struct { Owner string `json:"owner"` RepoSlug string `json:"repo_slug"` PrivateKey string `json:"private_key"` PublicKey string `json:"public_key"` }
type RepositoryPipelineOptions ¶
type RepositoryPipelineOptions struct { Owner string `json:"owner"` RepoSlug string `json:"repo_slug"` Enabled bool `json:"has_pipelines"` }
type RepositoryPipelineVariableOptions ¶
type RepositoryPipelineVariableOptions struct { Owner string `json:"owner"` RepoSlug string `json:"repo_slug"` Uuid string `json:"uuid"` Key string `json:"key"` Value string `json:"value"` Secured bool `json:"secured"` }
type RepositoryTag ¶
type RepositoryTag struct { Type string Name string Links map[string]interface{} Target map[string]interface{} Heads []map[string]interface{} }
type RepositoryTagOptions ¶
type RepositoryTagOptions struct { Owner string `json:"owner"` RepoSlug string `json:"repo_slug"` Query string `json:"q"` Sort string `json:"sort"` PageNum int `json:"page"` Pagelen int `json:"pagelen"` MaxDepth int `json:"max_depth"` }
type RepositoryTags ¶
type RepositoryTags struct { Page int Pagelen int MaxDepth int Size int Next string Tags []RepositoryTag }
type Teams ¶
type Teams struct {
// contains filtered or unexported fields
}
func (*Teams) Followers ¶
func (*Teams) Following ¶
func (*Teams) List ¶
func (*Teams) Members ¶
func (*Teams) Profile ¶
func (*Teams) Projects ¶
func (*Teams) Repositories ¶
type User ¶
type User struct { Uuid string Username string Nickname string Website string AccountStatus string `mapstructure:"account_status"` DisplayName string `mapstructure:"display_name"` CreatedOn string `mapstructure:"created_on"` Has2faEnabled bool `mapstructure:"has_2fa_enabled"` Links map[string]interface{} // contains filtered or unexported fields }
User is the sub struct of Client Reference: https://developer.atlassian.com/bitbucket/api/2/reference/resource/user
func (*User) Emails ¶
Emails is getting user's emails
func (*User) Profile ¶
Profile is getting the user data
type Users ¶
type Users struct {
// contains filtered or unexported fields
}
func (*Users) Followers ¶
func (*Users) Following ¶
func (*Users) Get ¶
func (*Users) Repositories ¶
type Webhooks ¶
type Webhooks struct {
// contains filtered or unexported fields
}
func (*Webhooks) Create ¶
func (r *Webhooks) Create(ro *WebhooksOptions) (interface{}, error)
func (*Webhooks) Delete ¶
func (r *Webhooks) Delete(ro *WebhooksOptions) (interface{}, error)
func (*Webhooks) Get ¶
func (r *Webhooks) Get(ro *WebhooksOptions) (interface{}, error)
func (*Webhooks) Gets ¶
func (r *Webhooks) Gets(ro *WebhooksOptions) (interface{}, error)
func (*Webhooks) Update ¶
func (r *Webhooks) Update(ro *WebhooksOptions) (interface{}, error)
type WebhooksOptions ¶
type WebhooksOptions struct { Owner string `json:"owner"` RepoSlug string `json:"repo_slug"` Uuid string `json:"uuid"` Description string `json:"description"` Url string `json:"url"` Active bool `json:"active"` Events []string `json:"events"` // EX) {'repo:push','issue:created',..} REF) https://goo.gl/VTj93b }
Source Files ¶
bitbucket.go branchrestrictions.go client.go commits.go diff.go downloads.go error.go pullrequests.go repositories.go repository.go teams.go user.go users.go webhooks.go
Directories ¶
Path | Synopsis |
---|---|
tests |
- Version
- v0.6.1
- Published
- Jun 19, 2020
- Platform
- darwin/amd64
- Imports
- 20 packages
- Last checked
- now –
Tools for package owners.