Documentation ¶
Index ¶
- Constants
- type Account
- type AccountResp
- type Bitbucket
- func (bb *Bitbucket) Activate(u *model.User, r *model.Repo, k *model.Key, link string) error
- func (bb *Bitbucket) Auth(token, secret string) (string, error)
- func (bb *Bitbucket) Deactivate(u *model.User, r *model.Repo, link string) error
- func (bb *Bitbucket) File(u *model.User, r *model.Repo, b *model.Build, f string) ([]byte, error)
- func (bb *Bitbucket) Hook(r *http.Request) (*model.Repo, *model.Build, error)
- func (bb *Bitbucket) Login(res http.ResponseWriter, req *http.Request) (*model.User, bool, error)
- func (bb *Bitbucket) Netrc(u *model.User, r *model.Repo) (*model.Netrc, error)
- func (bb *Bitbucket) Perm(u *model.User, owner, name string) (*model.Perm, error)
- func (bb *Bitbucket) Refresh(user *model.User) (bool, error)
- func (bb *Bitbucket) Repo(u *model.User, owner, name string) (*model.Repo, error)
- func (bb *Bitbucket) Repos(u *model.User) ([]*model.RepoLite, error)
- func (bb *Bitbucket) Status(u *model.User, r *model.Repo, b *model.Build, link string) error
- func (bb *Bitbucket) String() string
- type BuildStatus
- type Client
- func (c *Client) CreateHook(owner, name string, hook *Hook) error
- func (c *Client) CreateStatus(owner, name, revision string, status *BuildStatus) error
- func (c *Client) DeleteHook(owner, name, id string) error
- func (c *Client) FindCurrent() (*Account, error)
- func (c *Client) FindHook(owner, name, id string) (*Hook, error)
- func (c *Client) FindRepo(owner, name string) (*Repo, error)
- func (c *Client) FindSource(owner, name, revision, path string) (*Source, error)
- func (c *Client) ListEmail() (*EmailResp, error)
- func (c *Client) ListHooks(owner, name string, opts *ListOpts) (*HookResp, error)
- func (c *Client) ListRepos(account string, opts *ListOpts) (*RepoResp, error)
- func (c *Client) ListReposAll(account string) ([]*Repo, error)
- func (c *Client) ListTeams(opts *ListTeamOpts) (*AccountResp, error)
- type Email
- type EmailResp
- type Error
- type Hook
- type HookResp
- type Link
- type LinkClone
- type Links
- type ListOpts
- type ListTeamOpts
- type PullRequestHook
- type PushHook
- type Repo
- type RepoResp
- type Source
Constants ¶
const ( StatusPending = "INPROGRESS" StatusSuccess = "SUCCESSFUL" StatusFailure = "FAILED" )
const ( DescPending = "this build is pending" DescSuccess = "the build was successful" DescFailure = "the build failed" DescError = "oops, something went wrong" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountResp ¶
type Bitbucket ¶
func (*Bitbucket) Activate ¶
Activate activates a repository by creating the post-commit hook and adding the SSH deploy key, if applicable.
func (*Bitbucket) Auth ¶
Auth authenticates the session and returns the remote user login for the given token and secret
func (*Bitbucket) Deactivate ¶
Deactivate removes a repository by removing all the post-commit hooks which are equal to link and removing the SSH deploy key.
func (*Bitbucket) File ¶ added in v0.4.2
File fetches a file from the remote repository and returns in string format.
func (*Bitbucket) Hook ¶
Hook parses the post-commit hook from the Request body and returns the required data in a standard format.
func (*Bitbucket) Netrc ¶
Netrc returns a .netrc file that can be used to clone private repositories from a remote system.
func (*Bitbucket) Perm ¶
Perm fetches the named repository permissions from the remote system for the specified user.
func (*Bitbucket) Refresh ¶
Refresh refreshes an oauth token and expiration for the given user. It returns true if the token was refreshed, false if the token was not refreshed, and error if it failed to refersh.
type BuildStatus ¶ added in v0.4.2
type Client ¶
func (*Client) CreateStatus ¶ added in v0.4.2
func (c *Client) CreateStatus(owner, name, revision string, status *BuildStatus) error
func (*Client) DeleteHook ¶
func (*Client) FindCurrent ¶
func (*Client) FindSource ¶
func (*Client) ListTeams ¶
func (c *Client) ListTeams(opts *ListTeamOpts) (*AccountResp, error)
type ListTeamOpts ¶
func (*ListTeamOpts) Encode ¶
func (o *ListTeamOpts) Encode() string
type PullRequestHook ¶
type PullRequestHook struct { Actor Account `json:"actor"` Repo Repo `json:"repository"` PullRequest struct { ID int `json:"id"` Type string `json:"type"` Reason string `json:"reason"` Desc string `json:"description"` Title string `json:"title"` State string `json:"state"` Links Links `json:"links"` Created time.Time `json:"created_on"` Updated time.Time `json:"updated_on"` Source struct { Repo Repo `json:"repsoitory"` Commit struct { Hash string `json:"hash"` Links Links `json:"links"` } `json:"commit"` Branch struct { Name string `json:"name"` } `json:"branch"` } `json:"source"` Dest struct { Repo Repo `json:"repsoitory"` Commit struct { Hash string `json:"hash"` Links Links `json:"links"` } `json:"commit"` Branch struct { Name string `json:"name"` } `json:"branch"` } `json:"destination"` } `json:"pullrequest"` }
type PushHook ¶
type PushHook struct { Actor Account `json:"actor"` Repo Repo `json:"repository"` Push struct { Changes []struct { New struct { Type string `json:"type"` Name string `json:"name"` Target struct { Type string `json:"type"` Hash string `json:"hash"` Message string `json:"message"` Date time.Time `json:"date"` Links Links `json:"links"` Author struct { Raw string `json:"raw"` User Account `json:"user"` } `json:"author"` } `json:"target"` } `json:"new"` } `json:"changes"` } `json:"push"` }