bitbucket

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandler

func ErrorHandler(acceptStatuses ...int) requests.ResponseHandler

ErrorJSON validates the response has an acceptable status code and if it's bad, attempts to marshal the JSON into the error object provided.

Types

type BitbucketError

type BitbucketError struct {
	Errors []struct {
		Context       string `json:"context,omitempty"`
		Message       string `json:"message,omitempty"`
		ExceptionName string `json:"exceptionName,omitempty"`
	} `json:"errors,omitempty"`
}

type Client

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

Client is a tiny Github client

func NewClient

func NewClient(opts *ClientOpts) *Client

NewClient returns a new Github Client

func (*Client) Repos

func (c *Client) Repos() *RepoService

type ClientOpts

type ClientOpts struct {
	ApiBaseUrl string
	Username   string
	Token      string
	HttpClient *http.Client
}

type CreateRepoOpts

type CreateRepoOpts struct {
	Name          string
	Public        bool
	DefaultBranch string
	ProjectKey    string
}

type GetRepoOpts

type GetRepoOpts struct {
	ProjectKey string
	RepoSlug   string
}

type RepoInitOpts

type RepoInitOpts struct {
	ProjectKey string
	RepoSlug   string
	Title      string
}

type RepoService

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

RepoService provides methods for creating repositories.

func (*RepoService) Delete

func (s *RepoService) Delete(projectKey, slug string) error

func (*RepoService) DeleteUserPermissions

func (s *RepoService) DeleteUserPermissions(opts UserPermissionOpts) error

func (*RepoService) GetUserPermissions

func (s *RepoService) GetUserPermissions(opts UserPermissionOpts) (*UserPermission, error)

func (*RepoService) Init

func (s *RepoService) Init(opts RepoInitOpts) error

type Repository

type Repository struct {
	Name        string `json:"name"`
	ScmId       string `json:"scmId,omitempty"`
	Slug        string `json:"slug,omitempty"`
	Description string `json:"description,omitempty"`
	State       string `json:"state,omitempty"`
	Public      bool   `json:"public"`
	Project     struct {
		Key  string `json:"key"`
		Name string `json:"name"`
	} `json:"project"`
}

type StatusError

type StatusError struct {
	Code  int
	Inner error
}

func (StatusError) Error

func (e StatusError) Error() string

func (StatusError) Unwrap

func (e StatusError) Unwrap() error

type UserPermission

type UserPermission struct {
	User struct {
		Name string `json:"name"`
	}
	Permission string `json:"permission"`
}

type UserPermissionOpts

type UserPermissionOpts struct {
	ProjectKey string
	RepoSlug   string
	User       string
	Permission string
}

Jump to

Keyboard shortcuts

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