bitbucketserver

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(consumerKey string, privateKey []byte, URL, apiURL, uiURL, proxyURL, username, token string, store cache.Store, disableStatus bool) sdk.VCSServer

New creates a new bitbucketConsumer

Types

type AccessToken

type AccessToken struct {
	// contains filtered or unexported fields
}

AccessToken represents a value used by the Consumer to gain access to the Protected Resources on behalf of the User, instead of using the User's Service Provider credentials.

func NewAccessToken

func NewAccessToken(token, secret string, params map[string]string) *AccessToken

NewAccessToken returns a new instance of AccessToken with the specified token, secret and additional parameters.

func ParseAccessToken

func ParseAccessToken(reader io.ReadCloser) (*AccessToken, error)

ParseAccessToken parses the URL-encoded query string from the Reader and returns an AccessToken.

func ParseAccessTokenStr

func ParseAccessTokenStr(str string) (*AccessToken, error)

ParseAccessTokenStr parses the URL-encoded query string and returns an AccessToken.

func (*AccessToken) Encode

func (a *AccessToken) Encode() string

Encode encodes the values into “URL encoded” form of the AccessToken. e.g. "oauth_token=foo&oauth_token_secret=baz"

func (*AccessToken) Params

func (a *AccessToken) Params() map[string]string

Params gets any additional parameters, as defined by the Service Provider.

func (*AccessToken) Secret

func (a *AccessToken) Secret() string

Secret gets the oauth_token_secret value

func (*AccessToken) Token

func (a *AccessToken) Token() string

Token gets the oauth_token value

type Author

type Author struct {
	Name        string `json:"name"`
	Email       string `json:"emailAddress"`
	DisplayName string `json:"displayName"`
	Slug        string `json:"slug"`
}

type Branch

type Branch struct {
	ID         string `json:"id"`
	DisplayID  string `json:"displayId"`
	LatestHash string `json:"latestChangeset"`
	IsDefault  bool   `json:"isDefault"`
}

type BranchResponse

type BranchResponse struct {
	Values     []Branch `json:"values"`
	Size       int      `json:"size"`
	IsLastPage bool     `json:"isLastPage"`
}

type Clone

type Clone struct {
	URL  string `json:"href"`
	Name string `json:"name"`
}

type Commit

type Commit struct {
	Hash      string `json:"id"`
	Author    Author `json:"author"`
	Timestamp int64  `json:"authorTimestamp"`
	Message   string `json:"message"`
}

type CommitsResponse

type CommitsResponse struct {
	Values        []Commit `json:"values"`
	Size          int      `json:"size"`
	NextPageStart int      `json:"nextPageStart"`
	IsLastPage    bool     `json:"isLastPage"`
}

type Content

type Content struct {
	Lines []Lines `json:"lines"`
}

type GetWebHooksResponse

type GetWebHooksResponse struct {
	Values []WebHook `json:"values"`
}

GetWebHooksResponse represent the response send by bitbucket when listing webhooks

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 Key

type Key struct {
	ID    int64  `json:"id"`
	Text  string `json:"text"`
	Label string `json:"label"`
}

type Keys

type Keys struct {
	Values []Key `json:"values"`
}

type Lines

type Lines struct {
	Text string `json:"text"`
}
type Link struct {
	URL string `json:"url"`
	Rel string `json:"rel"`
}
type Links struct {
	Clone []Clone `json:"clone"`
	Self  []Clone `json:"self"`
}

type PullRequestResponse

type PullRequestResponse struct {
	Values        []sdk.BitbucketServerPullRequest `json:"values"`
	Size          int                              `json:"size"`
	NextPageStart int                              `json:"nextPageStart"`
	IsLastPage    bool                             `json:"isLastPage"`
}

type Repo

type Repo struct {
	Name    string                      `json:"name"`
	Slug    string                      `json:"slug"`
	Public  bool                        `json:"public"`
	ScmID   string                      `json:"scmId"`
	Project *sdk.BitbucketServerProject `json:"project"`
	Link    *Link                       `json:"link"`
	Links   *Links                      `json:"links"`
}

type RequestToken

type RequestToken struct {
	// contains filtered or unexported fields
}

RequestToken represents a value used by the Consumer to obtain authorization from the User, and exchanged for an Access Token.

func ParseRequestToken

func ParseRequestToken(reader io.ReadCloser) (*RequestToken, error)

ParseRequestToken parses the URL-encoded query string from the Reader and returns a RequestToken.

func ParseRequestTokenStr

func ParseRequestTokenStr(str string) (*RequestToken, error)

ParseRequestTokenStr parses the URL-encoded query string and returns a RequestToken.

func (*RequestToken) Encode

func (r *RequestToken) Encode() string

Encode encodes the values into “URL encoded” form of the ReqeustToken. e.g. "oauth_token=foo&oauth_token_secret=baz"

func (*RequestToken) Secret

func (r *RequestToken) Secret() string

Secret gets the oauth_token_secret value

func (*RequestToken) Token

func (r *RequestToken) Token() string

Token gets the oauth_token value

type Response

type Response struct {
	Values        []Repo `json:"values"`
	Size          int    `json:"size"`
	NextPageStart int    `json:"nextPageStart"`
	IsLastPage    bool   `json:"isLastPage"`
}

type ResponseStatus

type ResponseStatus struct {
	Values        []Status `json:"values"`
	Size          int      `json:"size"`
	NextPageStart int      `json:"nextPageStart"`
	IsLastPage    bool     `json:"isLastPage"`
}

type Status

type Status struct {
	Description string `json:"description"`
	Key         string `json:"key"`
	Name        string `json:"name"`
	State       string `json:"state"`
	URL         string `json:"url"`
	Timestamp   int64  `json:"dateAdded"`
}

type Tag

type Tag struct {
	ID              string `json:"id"`
	DisplayID       string `json:"displayId"`
	Type            string `json:"type"`
	LatestCommit    string `json:"latestCommit"`
	LatestChangeset string `json:"latestChangeset"`
	Hash            string `json:"hash"`
}

type TagResponse

type TagResponse struct {
	Values     []Tag `json:"values"`
	Size       int   `json:"size"`
	IsLastPage bool  `json:"isLastPage"`
}

type Token

type Token interface {
	Token() string  // Gets the oauth_token value.
	Secret() string // Gets the oauth_token_secret.
	Encode() string // Encode encodes the token into “URL encoded” form.
}

Token is an interface for RequestToken and AccessToken

type UserPermission

type UserPermission struct {
	User       sdk.BitbucketServerActor `json:"user"`
	Permission string                   `json:"permission"`
}

type UsersPermissionResponse

type UsersPermissionResponse struct {
	Values        []UserPermission `json:"values"`
	Size          int              `json:"size"`
	NextPageStart int              `json:"nextPageStart"`
	IsLastPage    bool             `json:"isLastPage"`
}

type UsersResponse

type UsersResponse struct {
	Values        []sdk.BitbucketServerActor `json:"values"`
	Size          int                        `json:"size"`
	NextPageStart int                        `json:"nextPageStart"`
	IsLastPage    bool                       `json:"isLastPage"`
}

type WebHook

type WebHook struct {
	ID            int               `json:"id,omitempty"`
	Active        bool              `json:"active"`
	Configuration map[string]string `json:"configuration"`
	Events        []string          `json:"events"`
	Name          string            `json:"name"`
	URL           string            `json:"url"`
}

WebHook Represent a webhook in bitbucket model

Jump to

Keyboard shortcuts

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