Golang implementation for the BitBucket API.
Please see v1 API and v2 API sections for API coverage, PR are very welcome.
Use Dep to add this library to your project:
dep ensure -add github.com/crossid/bitbucket-golang-api
v2 := bitbucket.NewV2BasicAuth(user, password)
v1 := bitbucket.NewV1BasicAuth(user, password)
Work with the API:
v2.Teams.List(bitbucket.ListTeamsOpts{Role: bitbucket.AdminRole})
Please check unit tests as they cover all supported features.
- Get a team
- List Teams (with support for pagination)
- List Team's members
- List Public Repos (with support for pagination, filtering and sorting)
- List Repos by Owner (with support for pagination, filtering and sorting)
- Get current user
- Get public user
- List groups matching one or more filters.
- List of an account's (team / user) groups
- List privileges of an account (team / user)
- List privileges of an account (team / user) for a specific repo
- List group privileges of an account (team / user)
- List group privileges of an account (team / user) for a specific repo
In order to run tests you should simply:
- Clone the project
- Set two env vars:
BITBUCKET_USER
&BITBUCKET_PASSWORD
with your Bitbucket username and password respectively - dep ensure
export BITBUCKET_USER=<user> ; export BITBUCKET_PASSWORD="<password>"; go test
Note: Unit tests assume that your user have at least:
- 2 teams
- 1 member per team
- 2 repositories
- https://github.com/emicklei/go-bitbucket - not updated for long time, contains very minimal APIs
- https://github.com/ktrysmt/go-bitbucket - active but we found it not clean enough, insufficient unit tests, no support for v1, no OAUTH support, minimal pagination support. s
APACHE 2