bitbucket

package
v0.0.0-...-a7087c3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2014 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAPI = "https://api.bitbucket.org/1.0"
	DefaultURL = "https://bitbucket.org"
)

Variables

This section is empty.

Functions

func Register

func Register()

Registers the Bitbucket plugin using the default settings from the config file or environment variables.

Types

type Bitbucket

type Bitbucket struct {
	URL    string
	API    string
	Client string
	Secret string
}

func New

func New(url, api, client, secret string) *Bitbucket

func NewDefault

func NewDefault(client, secret string) *Bitbucket

func (*Bitbucket) Activate

func (r *Bitbucket) Activate(user *model.User, repo *model.Repo, link string) error

Activate activates a repository by adding a Post-commit hook and a Public Deploy key, if applicable.

func (*Bitbucket) Authorize

func (r *Bitbucket) Authorize(res http.ResponseWriter, req *http.Request) (*model.Login, error)

Authorize handles Bitbucket API Authorization

func (*Bitbucket) GetHost

func (r *Bitbucket) GetHost() string

GetHost returns the hostname of this remote Bitbucket instance.

func (*Bitbucket) GetKind

func (r *Bitbucket) GetKind() string

GetKind returns the internal identifier of this remote Bitbucket instane.

func (*Bitbucket) GetRepos

func (r *Bitbucket) GetRepos(user *model.User) ([]*model.Repo, error)

GetRepos fetches all repositories that the specified user has access to in the remote system.

func (*Bitbucket) GetScript

func (r *Bitbucket) GetScript(user *model.User, repo *model.Repo, hook *model.Hook) ([]byte, error)

GetScript fetches the build script (.drone.yml) from the remote repository and returns in string format.

func (*Bitbucket) ParseHook

func (r *Bitbucket) ParseHook(req *http.Request) (*model.Hook, error)

ParseHook parses the post-commit hook from the Request body and returns the required data in a standard format.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL