Preface
Golang implementation for the BitBucket API.
Please see v1 API and v2 API sections for API coverage, PR are very welcome.
Add dependency
Use Dep to add this library to your project:
dep ensure -add github.com/crossid/bitbucket-golang-api
Insantiate a v1 or v2 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.
v2 API
Teams
Repositories
Users
v1 API
Groups
Privileges
Group Privileges
Running tests
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
Other projects
License
APACHE 2