Documentation
¶
Index ¶
- func IsNotFound(err error) bool
- func NotFoundError() error
- type Client
- func (c *Client) CreateAccessKey(ctx context.Context, repo bitbucket.Repo, key bitbucket.AccessKey) (bitbucket.AccessKey, error)
- func (c *Client) CreateWebhook(ctx context.Context, repo bitbucket.Repo, hook bitbucket.Webhook) (bitbucket.Webhook, error)
- func (c *Client) DeleteAccessKey(ctx context.Context, repo bitbucket.Repo, id int) error
- func (c *Client) DeleteWebhook(ctx context.Context, repo bitbucket.Repo, id int) error
- func (c *Client) GetAccessKey(ctx context.Context, repo bitbucket.Repo, id int) (bitbucket.AccessKey, error)
- func (c *Client) GetWebhook(ctx context.Context, repo bitbucket.Repo, id int) (bitbucket.Webhook, error)
- func (c *Client) ListAccessKeys(ctx context.Context, repo bitbucket.Repo) ([]bitbucket.AccessKey, error)
- func (c *Client) UpdateAccessKeyPermission(ctx context.Context, repo bitbucket.Repo, id int, permission string) error
- func (c *Client) UpdateWebhook(ctx context.Context, repo bitbucket.Repo, id int, hook bitbucket.Webhook) (bitbucket.Webhook, error)
- type GetKeysPayload
- type KeyDescription
- type KeyInfo
- type Pagination
- type ProjectInfo
- type PublicSSHKey
- type RepositoryInfo
- type UploadKeyPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
Client defines the API client
func (*Client) CreateAccessKey ¶
func (c *Client) CreateAccessKey(ctx context.Context, repo bitbucket.Repo, key bitbucket.AccessKey) (bitbucket.AccessKey, error)
CreateAccessKey on a repository by providing the public key
func (*Client) CreateWebhook ¶
func (c *Client) CreateWebhook(ctx context.Context, repo bitbucket.Repo, hook bitbucket.Webhook) (bitbucket.Webhook, error)
CreateWebhook creates the web hook
func (*Client) DeleteAccessKey ¶
DeleteAccessKey removes the key from the repository by provided access key id
func (*Client) DeleteWebhook ¶
DeleteWebhook deletes the web hook
func (*Client) GetAccessKey ¶
func (c *Client) GetAccessKey(ctx context.Context, repo bitbucket.Repo, id int) (bitbucket.AccessKey, error)
GetAccessKey finds accesskey given by bitbucket server access key id
func (*Client) GetWebhook ¶
func (c *Client) GetWebhook(ctx context.Context, repo bitbucket.Repo, id int) (bitbucket.Webhook, error)
GetWebhook gets the web hook
func (*Client) ListAccessKeys ¶
func (c *Client) ListAccessKeys(ctx context.Context, repo bitbucket.Repo) ([]bitbucket.AccessKey, error)
ListAccessKeys returns all access keys for the given repository
func (*Client) UpdateAccessKeyPermission ¶
func (c *Client) UpdateAccessKeyPermission(ctx context.Context, repo bitbucket.Repo, id int, permission string) error
UpdateAccessKeyPermission enables mutation of permissions on a accesskey by providing the id of the access key. Valid options are REPO_READ or REPO_WRITE
type GetKeysPayload ¶
type GetKeysPayload struct {
// Pagination is defined by the bitbucket server api
Pagination `json:",inline"`
// Values is defined by the bitbucket server api
Values []KeyDescription `json:"values"`
}
GetKeysPayload is the returned object from bitbucket server
type KeyDescription ¶
type KeyDescription struct {
// Key contains info about the access key
Key KeyInfo `json:"key"`
// Repository contains information about the repository where the access key is added
Repository RepositoryInfo `json:"repository"`
// Permission is the level of permission the access key has been granted
Permission string `json:"permission"`
}
KeyDescription describes a specific accesskey in bitbucket server
type Pagination ¶
type Pagination struct {
Size int `json:"size"`
Limit int `json:"limit"`
IsLastPage bool `json:"isLastPage"`
}
Pagination defines response pagination
type ProjectInfo ¶
type ProjectInfo struct {
Key string `json:"key"`
}
ProjectInfo contains information on the project
type PublicSSHKey ¶
type PublicSSHKey struct {
// Text contains the public key
Text string `json:"text"`
// Labels describes the public key
Label string `json:"label"`
}
PublicSSHKey represents the public ssh key
type RepositoryInfo ¶
type RepositoryInfo struct {
Name string `json:"name"`
ID int `json:"id"`
Project ProjectInfo
}
RepositoryInfo contains information about the repository
type UploadKeyPayload ¶
type UploadKeyPayload struct {
// Key defines the type of public ssh key
Key PublicSSHKey `json:"key"`
// Permissions defines the access level for the access key in bitbucket server
Permission string `json:"permission"`
}
UploadKeyPayload defines api object for key upload