Documentation
¶
Index ¶
- Constants
- func Provider() *schema.Provider
- func RandPlainSSHKeyPairSize(keySize int) (string, error)
- func RandSSHKeyPairSize(keySize int, comment string) (string, string, error)
- type BranchModel
- type BranchRestriction
- type BranchType
- type BranchingModel
- type Change
- type Changes
- type Client
- func (c *Client) Delete(endpoint string) (*http.Response, error)
- func (c *Client) Do(method, endpoint string, payload *bytes.Buffer, contentType string) (*http.Response, error)
- func (c *Client) Get(endpoint string) (*http.Response, error)
- func (c *Client) Post(endpoint string, jsonpayload *bytes.Buffer) (*http.Response, error)
- func (c *Client) PostNonJson(endpoint string, payload *bytes.Buffer) (*http.Response, error)
- func (c *Client) PostWithContentType(endpoint, contentType string, payload *bytes.Buffer) (*http.Response, error)
- func (c *Client) Put(endpoint string, jsonpayload *bytes.Buffer) (*http.Response, error)
- func (c *Client) PutOnly(endpoint string) (*http.Response, error)
- type Clients
- type Deployment
- type Error
- type Group
- type Hook
- type IPRange
- type PaginatedIPRanges
- type PaginatedReviewers
- type PaginatedUserEmails
- type ProviderConfig
- type RepositoryGroup
- type RepositoryGroupPermission
- type RepositoryInheritanceSettings
- type RepositoryUser
- type RepositoryUserPermission
- type Restrictions
- type Reviewer
- type SshKey
- type Stage
- type User
- type UserEmail
- type UserGroup
- type UserGroupMembership
Constants ¶
const ( // BitbucketEndpoint is the fqdn used to talk to bitbucket BitbucketEndpoint string = "https://api.bitbucket.org/" )
Variables ¶
This section is empty.
Functions ¶
func Provider ¶
Provider will create the necessary terraform provider to talk to the Bitbucket APIs you should either specify Username and App Password, OAuth Client Credentials or a valid OAuth Access Token.
See the Bitbucket authentication documentation for more: https://developer.atlassian.com/cloud/bitbucket/rest/intro/#authentication
func RandPlainSSHKeyPairSize ¶
func RandSSHKeyPairSize ¶
Taken from https://github.com/hashicorp/terraform-provider-aws/blob/187f1659a4fef11ac314567273b5470afe6b662f/internal/service/iam/acc_test.go RandSSHKeyPair generates a public and private SSH key pair. The public key is returned in OpenSSH format, and the private key is PEM encoded. Copied from github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest,
with the addition of the key size
Types ¶
type BranchModel ¶
type BranchRestriction ¶
type BranchRestriction struct {
ID int `json:"id,omitempty"`
Kind string `json:"kind,omitempty"`
BranchMatchkind string `json:"branch_match_kind,omitempty"`
BranchType string `json:"branch_type,omitempty"`
Pattern string `json:"pattern,omitempty"`
Value int `json:"value,omitempty"`
Users []User `json:"users,omitempty"`
Groups []Group `json:"groups,omitempty"`
}
BranchRestriction is the data we need to send to create a new branch restriction for the repository
type BranchType ¶
type BranchingModel ¶
type BranchingModel struct {
Development *BranchModel `json:"development,omitempty"`
Production *BranchModel `json:"production,omitempty"`
BranchTypes []*BranchType `json:"branch_types"`
}
BranchingModel is the data we need to send to create a new branching model for the repository
type Change ¶
type Change struct {
Name string `json:"name,omitempty"`
Restrictions Restrictions `json:"restrictions,omitempty"`
}
type Client ¶
type Client struct {
Username *string
Password *string
OAuthToken *string
OAuthTokenSource oauth2.TokenSource
HTTPClient *http.Client
}
Client is the base internal Client to talk to bitbuckets API. This should be a username and password the password should be a app-password.
func (*Client) Do ¶
func (c *Client) Do(method, endpoint string, payload *bytes.Buffer, contentType string) (*http.Response, error)
Do Will just call the bitbucket api but also add auth to it and some extra headers
func (*Client) PostNonJson ¶
PostNonJson is just a helper method to do but with a POST verb without Json Header
func (*Client) PostWithContentType ¶
func (c *Client) PostWithContentType(endpoint, contentType string, payload *bytes.Buffer) (*http.Response, error)
PostWithContentType is just a helper method to do but with a POST verb and a provided content type
type Deployment ¶
type Deployment struct {
Name string `json:"name"`
Stage *Stage `json:"environment_type"`
UUID string `json:"uuid,omitempty"`
Restrictions *Restrictions `json:"restrictions,omitempty"`
}
Deployment structure for handling key info
type Error ¶
type Error struct {
APIError struct {
Message string `json:"message,omitempty"`
} `json:"error,omitempty"`
Type string `json:"type,omitempty"`
StatusCode int
Endpoint string
}
Error represents a error from the bitbucket api.
type Hook ¶
type Hook struct {
UUID string `json:"uuid,omitempty"`
URL string `json:"url,omitempty"`
Description string `json:"description,omitempty"`
Active bool `json:"active"`
SkipCertVerification bool `json:"skip_cert_verification"`
Events []string `json:"events,omitempty"`
}
Hook is the hook you want to add to a bitbucket repository
type PaginatedIPRanges ¶
type PaginatedReviewers ¶
type PaginatedReviewers struct {
Values []Reviewer `json:"values,omitempty"`
Page int `json:"page,omitempty"`
Size int `json:"size,omitempty"`
Next string `json:"next,omitempty"`
}
PaginatedReviewers is a paginated list that the bitbucket api returns
type PaginatedUserEmails ¶
type ProviderConfig ¶
type RepositoryGroup ¶
type RepositoryGroupPermission ¶
type RepositoryGroupPermission struct {
Permission string `json:"permission"`
Group *RepositoryGroup `json:"group,omitempty"`
}
type RepositoryUser ¶
type RepositoryUser struct {
UUID string `json:"uuid,omitempty"`
}
type RepositoryUserPermission ¶
type RepositoryUserPermission struct {
Permission string `json:"permission"`
User *RepositoryUser `json:"user,omitempty"`
}
type Restrictions ¶
type Restrictions struct {
AdminOnly bool `json:"admin_only"`
}
type Reviewer ¶
type Reviewer struct {
DisplayName string `json:"display_name,omitempty"`
UUID string `json:"uuid,omitempty"`
Type string `json:"type,omitempty"`
}
Reviewer is teh default reviewer you want
type SshKey ¶
type SshKey struct {
ID int `json:"id,omitempty"`
UUID string `json:"uuid,omitempty"`
Key string `json:"key,omitempty"`
Label string `json:"label,omitempty"`
Comment string `json:"comment,omitempty"`
}
sshKey is the data we need to send to create a new SSH Key for the repository
type User ¶
type User struct {
Username string `json:"username,omitempty"`
}
User is just the user struct we want to use for BranchRestrictions
type UserGroupMembership ¶
type UserGroupMembership struct {
UUID string `json:"uuid,omitempty"`
}
Source Files
¶
- client.go
- data_current_user.go
- data_deployment.go
- data_group.go
- data_group_members.go
- data_groups.go
- data_hook_types.go
- data_ip_ranges.go
- data_pipeline_oidc_config.go
- data_pipeline_oidc_config_keys.go
- data_user.go
- data_workspace.go
- data_workspace_members.go
- error.go
- provider.go
- resource_branch_restriction.go
- resource_branching_model.go
- resource_commit_file.go
- resource_default_reviewers.go
- resource_deploy_key.go
- resource_deployment.go
- resource_deployment_variable.go
- resource_forked_repository.go
- resource_group.go
- resource_group_membership.go
- resource_hook.go
- resource_pipeline_schedule.go
- resource_pipeline_ssh_key.go
- resource_pipeline_ssh_known_host.go
- resource_project.go
- resource_project_branching_model.go
- resource_project_default_reviewers.go
- resource_repository.go
- resource_repository_group_permission.go
- resource_repository_user_permission.go
- resource_repository_variable.go
- resource_ssh_key.go
- resource_workspace_hook.go
- resource_workspace_variable.go
- utils.go