GithubHelp home page GithubHelp logo

codelingobot / ktrysmt-go-bitbucket Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ktrysmt/go-bitbucket

0.0 1.0 0.0 86 KB

Bitbucket API library for Golang.

License: Apache License 2.0

Makefile 1.51% Go 98.49%

ktrysmt-go-bitbucket's Introduction

go-bitbucket

go-bitbucket?status

Bitbucket-API library for golang.

Support Bitbucket API v2.0.

And the response type is json format defined Bitbucket API.

Install

go get github.com/ktrysmt/go-bitbucket

Usage

package main

import (
        "fmt"

        "github.com/ktrysmt/go-bitbucket" 
)

func main() {

        c := bitbucket.NewBasicAuth("username", "password")

        opt := &bitbucket.PullRequestsOptions{
                Owner:             "your-team",
                RepoSlug:          "awesome-project",
                SourceBranch:      "develop",
                DestinationBranch: "master",
                Title:             "fix bug. #9999",
                CloseSourceBranch: true,
        }

        res, err := c.Repositories.PullRequests.Create(opt)
        if err != nil {
                panic(err)
        }

        fmt.Println(res) 
}

FAQ

Support Bitbucket API v1.0 ?

It does not correspond yet. Because there are many differences between v2.0 and v1.0.

It is officially recommended to use v2.0.
But unfortunately Bitbucket Server (formerly: Stash) API is still v1.0.
And The API v1.0 covers resources that the v2.0 API and API v2.0 is yet to cover.

Development

Install dependencies

It's using dep.

go get github.com/golang/dep/...
git clone https://github.com/ktrysmt/go-bitbucket 
cd ./go-bitbucket
dep ensure 

How to testing

Set your available user account to Global Env.

export BITBUCKET_TEST_USERNAME=<your_username> 
export BITBUCKET_TEST_PASSWORD=<your_password> 
export BITBUCKET_TEST_OWNER=<your_repo_owner>  
export BITBUCKET_TEST_REPOSLUG=<your_repo_name>

Refs; URL Syntax is https://<your_username>:<your_password>@bitbucket.org/<your_repo_owner>/<your_repo_name>.git.

And just run,

make test

License

Apache License 2.0

Author

ktrysmt

ktrysmt-go-bitbucket's People

Contributors

ktrysmt avatar srgrn avatar ilius avatar analogj avatar xx-parks-xx avatar makkrnic avatar egorovv avatar soupdiver avatar noodlensk avatar mainiak avatar rcarmstrong avatar svedova avatar toneill-newinnov avatar phanatic avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.