Documentation
¶
Index ¶
Constants ¶
View Source
const (
// DefaultBaseURL defines the default Bitbucket API URL
DefaultBaseURL = "https://api.bitbucket.org/2.0"
)
Variables ¶
View Source
var ( // ErrResponseNotOK defines non-200 HTTP response error ErrResponseNotOK = errors.New("response is not 200") )
Functions ¶
This section is empty.
Types ¶
type AccessTokenResponse ¶
type AccessTokenResponse struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type,omitempty"` RefreshToken string `json:"refresh_token,omitempty"` Expiry int64 `json:"expires_in,omitempty"` }
AccessTokenResponse fields
type Bitbucket ¶
Bitbucket service client
func NewOauth2Client ¶
func NewOauth2Client(OAuthKey, OAuthSecret, username, password string, client *http.Client, endpoint *oauth2.Endpoint) (*Bitbucket, error)
NewOauth2Client generates a new Bitbucket service client with OAuth2 cred.
func (*Bitbucket) UserRepository ¶
func (bb *Bitbucket) UserRepository(userSlug, repoSlug string) (*Repository, error)
UserRepository fetches a user's repository
type BranchInfo ¶
BranchInfo fields
type OAuth2Config ¶
OAuth2Config contains OAuth2 configs for Bitbucket
type Owner ¶
type Owner struct { Username string `json:"username"` DisplayName string `json:"display_name"` Type string `json:"type"` UUID string `json:"uuid"` }
Owner fields
type Project ¶
type Project struct { Key string `json:"key"` Type string `json:"type"` UUID string `json:"uuid"` Links *ProjectLinks `json:"links"` Name string `json:"name"` }
Project fields
type ProjectLinks ¶
type ProjectLinks struct { Self *Link `json:"self"` HTML *Link `json:"html"` Avatar *Link `json:"avatar"` }
ProjectLinks fields
type Repository ¶
type Repository struct { SCM string `json:"scm"` Website string `json:"website"` HasWiki bool `json:"has_wiki"` UUID string `json:"uuid"` Links *RepositoryLinks `json:"links"` ForkPolicy string `json:"fork_policy"` Name string `json:"name"` Project *Project `json:"project"` Language string `json:"language"` CreatedOn string `json:"created_on"` MainBranch *BranchInfo `json:"mainbranch"` FullName string `json:"full_name"` HasIssues bool `json:"has_issues"` Owner *Owner `json:"owner"` UpdatedOn string `json:"updated_on"` Size int64 `json:"size"` Type string `json:"type"` Slug string `json:"slug"` IsPrivate bool `json:"is_private"` Description string `json:"description"` }
Repository fields
type RepositoryLinks ¶
type RepositoryLinks struct { Watchers *Link `json:"watchers"` Branches *Link `json:"branches"` Tags *Link `json:"tags"` Commits *Link `json:"commits"` Clone []*Link `json:"clone"` Self *Link `json:"self"` Source *Link `json:"source"` HTML *Link `json:"html"` Avatar *Link `json:"avatar"` Hooks *Link `json:"hooks"` Forks *Link `json:"forks"` Downloads *Link `json:"downloads"` PullRequests *Link `json:"pullrequests"` }
RepositoryLinks fields
Click to show internal directories.
Click to hide internal directories.