bitbucket

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPermission represents permission related errors
	ErrPermission = errors.New("permission")
	// ErrNotFound represents errors where the resource being fetched was not found
	ErrNotFound = errors.New("not_found")
	// ErrResponseMalformed represents errors related to api responses that do not match internal representation
	ErrResponseMalformed = errors.New("response_malformed")
	// ErrConflict is used when a duplicate resource is trying to be created
	ErrConflict = errors.New("conflict")
)

Functions

This section is empty.

Types

type BitBucketService

type BitBucketService struct {
	Projects     ProjectService
	Repositories RepositoryService
}

func NewService

func NewService(client *Client) (*BitBucketService, error)

type Client

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

Client encapsulates a client that talks to the bitbucket server api API Docs: https://developer.atlassian.com/server/bitbucket/rest/v805/intro/

func NewClient

func NewClient(baseURL string, base64creds string, caCertPath *string) (*Client, error)

NewClient creates a new instance of the bitbucket client

type CreateProjectRequest

type CreateProjectRequest struct {
	Name        string `json:"name"`
	Key         string `json:"key"`
	Description string `json:"description,omitempty"`
	Public      bool   `json:"public,omitempty"`
}

CreateProjectRequest contains the fields required to create a project

type DeleteProjectRequest

type DeleteProjectRequest struct {
	Key string `json:"key"`
}

DeleteProjectRequest contains the fields required to delete a project

type GetProjectRequest

type GetProjectRequest struct {
	Key string `json:"key"`
}

GetProjectRequest contains the fields required to fetch a project

type Group added in v0.0.6

type Group struct {
	Name       string
	Permission string
}

type Project

type Project struct {
	Name        string `json:"name"`
	Key         string `json:"key"`
	ID          int    `json:"id"`
	Description string `json:"description"`
	Scope       string `json:"scope,omitempty"`
	Type        string `json:"type"`
	Public      bool   `json:"public"`
}

Project represents a Bitbucket Project

type ProjectService

ProjectService provides operations around bitbucket projects

type Repository

type Repository struct {
	ID          int    `json:"-"`
	Name        string `json:"name"`
	Public      bool   `json:"public"`
	Project     string `json:"-"`
	Description string `json:"description"`
}

type RepositoryService

type RepositoryService interface {
	Get(context.Context, *Repository) (*Repository, error)
	Create(context.Context, *Repository) (*Repository, error)
	Update(context.Context, *Repository) (*Repository, error)
	Delete(context.Context, *Repository) error
	// Groups permissions
	GetGroups(context.Context, *Repository) ([]Group, error)
	AddGroup(context.Context, *Repository, *Group) error
	RevokeGroup(context.Context, *Repository, *Group) error
}

type UpdateProjectRequest

type UpdateProjectRequest struct {
	Key         string `json:"key"`
	Description string `json:"description,omitempty"`
	Public      bool   `json:"public,omitempty"`
}

UpdateProjectRequest contains the fields required to update a project

Jump to

Keyboard shortcuts

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