bitbucket

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PermissionRepoWrite grants read write permissions to the repository
	PermissionRepoWrite = "REPO_WRITE"
	// PermissionRepoRead grants read only permissions to the repository
	PermissionRepoRead = "REPO_READ"
)

Variables

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound returned when item is not found

Functions

This section is empty.

Types

type AccessKey

type AccessKey struct {
	// Key is the public ssh key
	Key string
	// Label is the text description of the key
	Label string
	// ID is the number the access key is given by server
	ID int
	// Permission is either PermissionRepoRead or PermissionRepoWrite
	Permission string
}

AccessKey defines the api object for bitbucket server

type KeyClientAPI

type KeyClientAPI interface {
	CreateAccessKey(ctx context.Context, repo Repo, key AccessKey) (result AccessKey, err error)
	DeleteAccessKey(ctx context.Context, repo Repo, id int) (err error)
	GetAccessKey(ctx context.Context, repo Repo, id int) (result AccessKey, err error)
	ListAccessKeys(ctx context.Context, repo Repo) (result []AccessKey, err error)
	UpdateAccessKeyPermission(ctx context.Context, repo Repo, id int, permission string) (err error)
}

KeyClientAPI is the API for creating/listing/deleting/getting access keys

type Repo

type Repo struct {
	ProjectKey string
	Repo       string
}

Repo struct

type Webhook

type Webhook struct {
	// ID of the webhook in the server
	ID int `json:"id"`

	// Name of the webhook
	Name string `json:"name"`

	// Configuration contains webhook configurations
	Configuration struct {
		// Secret defines the authentication key that the bitbucket server HMAC signes the payload
		Secret string `json:"secret"`
	} `json:"configuration"`

	// Events defines for which events the webhook subscribes
	Events []string `json:"events"`

	// URL is the enpoint that bitbucket server should POST events to
	URL string `json:"url"`
}

Webhook defines the api object for the bitbucket server objet webhook

type WebhookClientAPI

type WebhookClientAPI interface {
	CreateWebhook(ctx context.Context, repo Repo, webhook Webhook) (result Webhook, err error)
	DeleteWebhook(ctx context.Context, repo Repo, id int) (err error)
	GetWebhook(ctx context.Context, repo Repo, id int) (result Webhook, err error)
	UpdateWebhook(ctx context.Context, repo Repo, id int, webhook Webhook) (result Webhook, err error)
}

WebhookClientAPI is the API for creating/listing/deleting/getting webhooks

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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