bitbucket

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2015 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 GetKeyTitle

func GetKeyTitle(rawurl string) (string, error)

GetKeyTitle is a helper function that generates a title for the RSA public key based on the username and domain name.

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
	Open   bool
}

func New

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

func NewDefault

func NewDefault(client, secret string, open bool) *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) Deactivate

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

Deactivate removes a repository by removing all the post-commit hooks which are equal to link and removing the SSH deploy key.

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) GetToken

func (r *Bitbucket) GetToken(user *model.User) (*model.Token, error)

func (*Bitbucket) OpenRegistration

func (r *Bitbucket) OpenRegistration() bool

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