bitbucket

package module
v0.0.0-...-5eaf894 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 12 Imported by: 0

README

go-bitbucket

Documentation

Index

Constants

View Source
const (
	DefaultBitbucketApiBaseUrl = "https://api.bitbucket.org/2.0"
	DefaultHeaderAccept        = "application/json"
	// DefaultPageLength is the default page length for paginated requests. More details here:
	// https://developer.atlassian.com/cloud/bitbucket/rest/intro/#pagination
	DefaultPageLength = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HttpClient *http.Client

	User         userApiGroup
	Workspaces   workspacesApiGroup
	Deployments  deploymentsApiGroup
	Pipelines    pipelinesApiGroup
	Repositories repositoriesApiGroup

	Debug bool
	// contains filtered or unexported fields
}

func NewClientWithBasicAuth

func NewClientWithBasicAuth(user, password string) *Client

func NewClientWithBearerToken

func NewClientWithBearerToken(token string) *Client

type DeploymentsApiGroup

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

func (*DeploymentsApiGroup) CreateEnvironment

func (d *DeploymentsApiGroup) CreateEnvironment(workspace, repoSlug string, environment Environment) (*Environment, error)

func (*DeploymentsApiGroup) DeleteEnvironment

func (d *DeploymentsApiGroup) DeleteEnvironment(workspace, repoSlug, environmentUuid string) error

func (*DeploymentsApiGroup) GetEnvironment

func (d *DeploymentsApiGroup) GetEnvironment(workspace, repoSlug, environmentUuid string) (*Environment, error)

func (*DeploymentsApiGroup) ListEnvironments

func (d *DeploymentsApiGroup) ListEnvironments(workspace, repoSlug string) ([]Environment, error)

type Environment

type Environment struct {
	Object
	Uuid            string          `json:"uuid,omitempty"`
	Name            string          `json:"name"`
	Slug            string          `json:"slug,omitempty"`
	EnvironmentType EnvironmentType `json:"environment_type"`
}

type EnvironmentType

type EnvironmentType struct {
	Object
	Name EnvironmentTypeName `json:"name"`
	Rank EnvironmentTypeRank `json:"rank"`
}

type EnvironmentTypeName

type EnvironmentTypeName string
const (
	EnvironmentTypeProduction EnvironmentTypeName = "Production"
	EnvironmentTypeStaging    EnvironmentTypeName = "Staging"
	EnvironmentTypeTest       EnvironmentTypeName = "Test"
)

type EnvironmentTypeRank

type EnvironmentTypeRank int
const (
	EnvironmentTypeRankProduction EnvironmentTypeRank = 2
	EnvironmentTypeRankStaging    EnvironmentTypeRank = 1
	EnvironmentTypeRankTest       EnvironmentTypeRank = 0
)

type EnvironmentsPage

type EnvironmentsPage struct {
	Page
	Values []Environment `json:"values"`
}

func (*EnvironmentsPage) GetSize

func (p *EnvironmentsPage) GetSize() int

func (*EnvironmentsPage) GetValues

func (p *EnvironmentsPage) GetValues() []Typer
type Link struct {
	Href string `json:"href"`
}

type Object

type Object struct {
	Type string `json:"type"`
}

func (Object) GetType

func (o Object) GetType() string

type Page

type Page struct {
	Size     int    `json:"size"`
	Page     int    `json:"page"`
	PageLen  int    `json:"pagelen"`
	Next     string `json:"next"`
	Previous string `json:"previous"`
}

type Pager

type Pager interface {
	GetValues() []Typer
	GetSize() int
}

type PipelinesApiGroup

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

func (*PipelinesApiGroup) CreateVariableForEnvironment

func (p *PipelinesApiGroup) CreateVariableForEnvironment(workspace, repoSlug, environmentUuid string, variable Variable) (*Variable, error)

func (*PipelinesApiGroup) GetConfiguration

func (p *PipelinesApiGroup) GetConfiguration(workspace, repoSlug string) (*PipelinesConfiguration, error)

func (*PipelinesApiGroup) GetVariableForWorkspace

func (p *PipelinesApiGroup) GetVariableForWorkspace(workspace, variableUuid string) (*Variable, error)

func (*PipelinesApiGroup) ListVariablesForEnvironment

func (p *PipelinesApiGroup) ListVariablesForEnvironment(workspace, repoSlug, environmentUuid string) ([]Variable, error)

func (*PipelinesApiGroup) UpdateConfiguration

func (p *PipelinesApiGroup) UpdateConfiguration(workspace, repoSlug string, configuration PipelinesConfiguration) (*PipelinesConfiguration, error)

func (*PipelinesApiGroup) UpdateVariableForEnvironment

func (p *PipelinesApiGroup) UpdateVariableForEnvironment(workspace, repoSlug, environmentUuid, variableUuid string, variable Variable) (*Variable, error)

type PipelinesConfiguration

type PipelinesConfiguration struct {
	Object
	Enabled bool `json:"enabled"`
}

type Project

type Project struct {
	Object
	Key  string `json:"key"`
	Uuid string `json:"uuid"`
}

type RepositoriesApiGroup

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

func (*RepositoriesApiGroup) ListRepositoriesInWorkspace

func (r *RepositoriesApiGroup) ListRepositoriesInWorkspace(workspace string) ([]Repository, error)

type RepositoriesPage

type RepositoriesPage struct {
	Page
	Values []Repository `json:"values"`
}

func (*RepositoriesPage) GetSize

func (p *RepositoriesPage) GetSize() int

func (*RepositoriesPage) GetValues

func (p *RepositoriesPage) GetValues() []Typer

type Repository

type Repository struct {
	Object
	Uuid      string  `json:"uuid"`
	Slug      string  `json:"slug"`
	FullName  string  `json:"full_name"`
	Name      string  `json:"name"`
	IsPrivate bool    `json:"is_private"`
	Project   Project `json:"project"`
}

type RequestOptions

type RequestOptions struct {
	Method      string
	Path        string
	IsPageable  bool
	CurrentPage int
	HasNextPage bool
	Data        interface{}
}

type Typer

type Typer interface {
	GetType() string
}

type User

type User struct {
	Object
	Username    string    `json:"username"`
	DisplayName string    `json:"display_name"`
	Uuid        string    `json:"uuid"`
	Links       UserLinks `json:"links"`
	CreatedOn   string    `json:"created_on"`
}

type UserApiGroup

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

func (*UserApiGroup) GetCurrentUser

func (u *UserApiGroup) GetCurrentUser() (*User, error)
type UserLinks struct {
	Avatar Link `json:"avatar"`
}

type Variable

type Variable struct {
	Object
	Uuid    string `json:"uuid,omitempty"`
	Key     string `json:"key"`
	Value   string `json:"value"`
	Secured bool   `json:"secured"`
}

type VariablesPage

type VariablesPage struct {
	Page
	Values []Variable `json:"values"`
}

func (*VariablesPage) GetSize

func (p *VariablesPage) GetSize() int

func (*VariablesPage) GetValues

func (p *VariablesPage) GetValues() []Typer

type Workspace

type Workspace struct {
	Object
	Name      string         `json:"name"`
	Slug      string         `json:"slug"`
	Uuid      string         `json:"uuid"`
	IsPrivate bool           `json:"is_private"`
	CreatedOn string         `json:"created_on"`
	Links     WorkspaceLinks `json:"links"`
}
type WorkspaceLinks struct {
	Avatar Link `json:"avatar"`
	Html   Link `json:"html"`
	Self   Link `json:"self"`
}

type WorkspacesApiGroup

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

func (*WorkspacesApiGroup) GetWorkspace

func (w *WorkspacesApiGroup) GetWorkspace(name string) (*Workspace, error)

Jump to

Keyboard shortcuts

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