bitbucket

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2020 License: MPL-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// BitbucketEndpoint is the fqdn used to talk to bitbucket
	BitbucketEndpoint string = "https://api.bitbucket.org/"
)

Variables

This section is empty.

Functions

func Provider

func Provider() terraform.ResourceProvider

Provider will create the necessary terraform provider to talk to the Bitbucket APIs you should specify a USERNAME and PASSWORD

Types

type BranchRestriction added in v1.2.0

type BranchRestriction struct {
	ID      int     `json:"id,omitempty"`
	Kind    string  `json:"kind,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 Client added in v1.2.0

type Client struct {
	Username   string
	Password   string
	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) Delete added in v1.2.0

func (c *Client) Delete(endpoint string) (*http.Response, error)

Delete is just a helper to Do but with a DELETE verb

func (*Client) Do added in v1.2.0

func (c *Client) Do(method, endpoint string, payload *bytes.Buffer) (*http.Response, error)

Do Will just call the bitbucket api but also add auth to it and some extra headers

func (*Client) Get added in v1.2.0

func (c *Client) Get(endpoint string) (*http.Response, error)

Get is just a helper method to do but with a GET verb

func (*Client) Post added in v1.2.0

func (c *Client) Post(endpoint string, jsonpayload *bytes.Buffer) (*http.Response, error)

Post is just a helper method to do but with a POST verb

func (*Client) Put added in v1.2.0

func (c *Client) Put(endpoint string, jsonpayload *bytes.Buffer) (*http.Response, error)

Put is just a helper method to do but with a PUT verb

func (*Client) PutOnly added in v1.2.0

func (c *Client) PutOnly(endpoint string) (*http.Response, error)

PutOnly is just a helper method to do but with a PUT verb and a nil body

type CloneURL added in v1.2.0

type CloneURL struct {
	Href string `json:"href,omitempty"`
	Name string `json:"name,omitempty"`
}

CloneURL is the internal struct we use to represent urls

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.

func (Error) Error

func (e Error) Error() string

type Group added in v1.2.0

type Group struct {
	Slug  string `json:"slug,omitempty"`
	Owner User   `json:"owner,omitempty"`
}

Group is the group we want to add to a branch restriction

type Hook

type Hook struct {
	UUID                 string   `json:"uuid,omitempty"`
	URL                  string   `json:"url,omitempty"`
	Description          string   `json:"description,omitempty"`
	Active               bool     `json:"active,omitempty"`
	SkipCertVerification bool     `json:"skip_cert_verification,omitempty"`
	Events               []string `json:"events,omitempty"`
}

Hook is the hook you want to add to a bitbucket repository

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 PipelinesEnabled added in v1.2.0

type PipelinesEnabled struct {
	Enabled bool `json:"enabled"`
}

PipelinesEnabled is the struct we send to turn on or turn off pipelines for a repository

type Project added in v1.2.0

type Project struct {
	Key         string `json:"key,omitempty"`
	IsPrivate   bool   `json:"is_private,omitempty"`
	Owner       string `json:"owner.username,omitempty"`
	Description string `json:"description,omitempty"`
	Name        string `json:"name,omitempty"`
	UUID        string `json:"uuid,omitempty"`
}

Project is the project data we need to send to create a project on the bitbucket api

type Repository

type Repository struct {
	SCM         string `json:"scm,omitempty"`
	HasWiki     bool   `json:"has_wiki,omitempty"`
	HasIssues   bool   `json:"has_issues,omitempty"`
	Website     string `json:"website,omitempty"`
	IsPrivate   bool   `json:"is_private,omitempty"`
	ForkPolicy  string `json:"fork_policy,omitempty"`
	Language    string `json:"language,omitempty"`
	Description string `json:"description,omitempty"`
	Name        string `json:"name,omitempty"`
	Slug        string `json:"slug,omitempty"`
	UUID        string `json:"uuid,omitempty"`
	Project     struct {
		Key string `json:"key,omitempty"`
	} `json:"project,omitempty"`
	Links struct {
		Clone []CloneURL `json:"clone,omitempty"`
	} `json:"links,omitempty"`
}

Repository is the struct we need to send off to the Bitbucket API to create a repository

type RepositoryVariable added in v1.2.0

type RepositoryVariable struct {
	Key     string `json:"key"`
	Value   string `json:"value"`
	UUID    string `json:"uuid,omitempty"`
	Secured bool   `json:"secured"`
}

RepositoryVariable structure for handling key info

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 User added in v1.2.0

type User struct {
	Username string `json:"username,omitempty"`
}

User is just the user struct we want to use for BranchRestrictions

Jump to

Keyboard shortcuts

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