bitbucketserver

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2016 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(ConsumerRSA string, ConsumerKey string, URL string) *oauth.Consumer

func NewClientWithToken

func NewClientWithToken(Consumer *oauth.Consumer, AccessToken string) *http.Client

Types

type BSRepo

type BSRepo struct {
	Forkable bool `json:"forkable"`
	ID       int  `json:"id"`
	Links    struct {
		Clone []struct {
			Href string `json:"href"`
			Name string `json:"name"`
		} `json:"clone"`
		Self []struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"links"`
	Name    string `json:"name"`
	Project struct {
		Description string `json:"description"`
		ID          int    `json:"id"`
		Key         string `json:"key"`
		Links       struct {
			Self []struct {
				Href string `json:"href"`
			} `json:"self"`
		} `json:"links"`
		Name   string `json:"name"`
		Public bool   `json:"public"`
		Type   string `json:"type"`
	} `json:"project"`
	Public        bool   `json:"public"`
	ScmID         string `json:"scmId"`
	Slug          string `json:"slug"`
	State         string `json:"state"`
	StatusMessage string `json:"statusMessage"`
}

type BitbucketServer

type BitbucketServer struct {
	URL         string
	ConsumerKey string
	GitUserName string
	GitPassword string
	ConsumerRSA string
	Open        bool
	Consumer    oauth.Consumer
}

func Load

func Load(config string) *BitbucketServer

func (*BitbucketServer) Activate

func (bs *BitbucketServer) Activate(u *model.User, r *model.Repo, k *model.Key, link string) error

func (*BitbucketServer) Auth

func (bs *BitbucketServer) Auth(token, secret string) (string, error)

func (*BitbucketServer) CreateHook

func (bs *BitbucketServer) CreateHook(client *http.Client, project, slug, hook_key, link string) (*Hook, error)

Enable hook for named repository

func (*BitbucketServer) Deactivate

func (bs *BitbucketServer) Deactivate(u *model.User, r *model.Repo, link string) error

func (*BitbucketServer) DeleteHook

func (bs *BitbucketServer) DeleteHook(client *http.Client, project, slug, hook_key, link string) error

Disable hook for named repository

func (*BitbucketServer) File

func (bs *BitbucketServer) File(u *model.User, r *model.Repo, b *model.Build, f string) ([]byte, error)

func (*BitbucketServer) Hook

func (bs *BitbucketServer) Hook(r *http.Request) (*model.Repo, *model.Build, error)

func (*BitbucketServer) Login

func (bs *BitbucketServer) Login(res http.ResponseWriter, req *http.Request) (*model.User, bool, error)

func (*BitbucketServer) Netrc

func (bs *BitbucketServer) Netrc(user *model.User, r *model.Repo) (*model.Netrc, error)

func (*BitbucketServer) Perm

func (bs *BitbucketServer) Perm(u *model.User, owner, repo string) (*model.Perm, error)

func (*BitbucketServer) Repo

func (bs *BitbucketServer) Repo(u *model.User, owner, name string) (*model.Repo, error)

func (*BitbucketServer) Repos

func (bs *BitbucketServer) Repos(u *model.User) ([]*model.RepoLite, error)

func (*BitbucketServer) Status

func (bs *BitbucketServer) Status(u *model.User, r *model.Repo, b *model.Build, link string) error

func (*BitbucketServer) String

func (bs *BitbucketServer) String() string

type Hook

type Hook struct {
	Enabled bool        `"json:enabled"`
	Details *HookDetail `"json:details"`
}

type HookDetail

type HookDetail struct {
	Key           string `"json:key"`
	Name          string `"json:name"`
	Type          string `"json:type"`
	Description   string `"json:description"`
	Version       string `"json:version"`
	ConfigFormKey string `"json:configFormKey"`
}

type Repos

type Repos struct {
	IsLastPage bool `json:"isLastPage"`
	Limit      int  `json:"limit"`
	Size       int  `json:"size"`
	Start      int  `json:"start"`
	Values     []struct {
		Forkable bool `json:"forkable"`
		ID       int  `json:"id"`
		Links    struct {
			Clone []struct {
				Href string `json:"href"`
				Name string `json:"name"`
			} `json:"clone"`
			Self []struct {
				Href string `json:"href"`
			} `json:"self"`
		} `json:"links"`
		Name    string `json:"name"`
		Project struct {
			Description string `json:"description"`
			ID          int    `json:"id"`
			Key         string `json:"key"`
			Links       struct {
				Self []struct {
					Href string `json:"href"`
				} `json:"self"`
			} `json:"links"`
			Name   string `json:"name"`
			Public bool   `json:"public"`
			Type   string `json:"type"`
		} `json:"project"`
		Public        bool   `json:"public"`
		ScmID         string `json:"scmId"`
		Slug          string `json:"slug"`
		State         string `json:"state"`
		StatusMessage string `json:"statusMessage"`
	} `json:"values"`
}

type User

type User struct {
	Active       bool   `json:"active"`
	DisplayName  string `json:"displayName"`
	EmailAddress string `json:"emailAddress"`
	ID           int    `json:"id"`
	Links        struct {
		Self []struct {
			Href string `json:"href"`
		} `json:"self"`
	} `json:"links"`
	Name string `json:"name"`
	Slug string `json:"slug"`
	Type string `json:"type"`
}

Jump to

Keyboard shortcuts

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