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/
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 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 ¶
type ProjectService interface { Get(context.Context, *GetProjectRequest) (*Project, error) Create(context.Context, *CreateProjectRequest) (*Project, error) Update(context.Context, *UpdateProjectRequest) (*Project, error) Delete(context.Context, *DeleteProjectRequest) error }
ProjectService provides operations around bitbucket projects
type Repository ¶
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
Click to show internal directories.
Click to hide internal directories.