Socket
Socket
Sign inDemoInstall

github.com/crossid/bitbucket-golang-api

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/crossid/bitbucket-golang-api


Version published

Readme

Source

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

  • Get a team
  • List Teams (with support for pagination)
  • List Team's members

Repositories

  • List Public Repos (with support for pagination, filtering and sorting)
  • List Repos by Owner (with support for pagination, filtering and sorting)

Users

  • Get current user
  • Get public user

v1 API

Groups

  • List groups matching one or more filters.
  • List of an account's (team / user) groups

Privileges

  • List privileges of an account (team / user)
  • List privileges of an account (team / user) for a specific repo

Group Privileges

  • List group privileges of an account (team / user)
  • List group privileges of an account (team / user) for a specific repo

Running tests

In order to run tests you should simply:

  1. Clone the project
  2. Set two env vars: BITBUCKET_USER & BITBUCKET_PASSWORD with your Bitbucket username and password respectively
  3. dep ensure
  4. 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

FAQs

Last updated on 09 Jan 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc