Documentation ¶
Index ¶
- type BitbucketServer
- func (b *BitbucketServer) ClosePullRequest(ctx context.Context, pr scm.PullRequest) error
- func (b *BitbucketServer) CreatePullRequest(ctx context.Context, repo scm.Repository, prRepo scm.Repository, ...) (scm.PullRequest, error)
- func (b *BitbucketServer) ForkRepository(_ context.Context, _ scm.Repository, _ string) (scm.Repository, error)
- func (b *BitbucketServer) GetOpenPullRequest(ctx context.Context, repo scm.Repository, branchName string) (scm.PullRequest, error)
- func (b *BitbucketServer) GetPullRequests(ctx context.Context, branchName string) ([]scm.PullRequest, error)
- func (b *BitbucketServer) GetRepositories(ctx context.Context) ([]scm.Repository, error)
- func (b *BitbucketServer) MergePullRequest(ctx context.Context, pr scm.PullRequest) error
- func (b *BitbucketServer) UpdatePullRequest(_ context.Context, _ scm.Repository, pullReq scm.PullRequest, ...) (scm.PullRequest, error)
- type RepositoryListing
- type RepositoryReference
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitbucketServer ¶
type BitbucketServer struct { RepositoryListing // contains filtered or unexported fields }
BitbucketServer is a SCM instance of Bitbucket Server the on-prem version of Bitbucket
func New ¶
func New(username, token, baseURL string, insecure bool, sshAuth bool, transportMiddleware func(http.RoundTripper) http.RoundTripper, repoListing RepositoryListing) (*BitbucketServer, error)
New create a new BitbucketServer client
func (*BitbucketServer) ClosePullRequest ¶
func (b *BitbucketServer) ClosePullRequest(ctx context.Context, pr scm.PullRequest) error
ClosePullRequest Close a pull request, the pr parameter will always originate from the same package
func (*BitbucketServer) CreatePullRequest ¶
func (b *BitbucketServer) CreatePullRequest(ctx context.Context, repo scm.Repository, prRepo scm.Repository, newPR scm.NewPullRequest) (scm.PullRequest, error)
CreatePullRequest Creates a pull request. The repo parameter will always originate from the same package
func (*BitbucketServer) ForkRepository ¶
func (b *BitbucketServer) ForkRepository(_ context.Context, _ scm.Repository, _ string) (scm.Repository, error)
ForkRepository forks a repository. If newOwner is set, use it, otherwise fork to the current user
func (*BitbucketServer) GetOpenPullRequest ¶ added in v0.37.0
func (b *BitbucketServer) GetOpenPullRequest(ctx context.Context, repo scm.Repository, branchName string) (scm.PullRequest, error)
GetOpenPullRequest gets a pull request for one specific repository
func (*BitbucketServer) GetPullRequests ¶
func (b *BitbucketServer) GetPullRequests(ctx context.Context, branchName string) ([]scm.PullRequest, error)
GetPullRequests Gets the latest pull requests from repositories based on the scm configuration
func (*BitbucketServer) GetRepositories ¶
func (b *BitbucketServer) GetRepositories(ctx context.Context) ([]scm.Repository, error)
GetRepositories Should get repositories based on the scm configuration
func (*BitbucketServer) MergePullRequest ¶
func (b *BitbucketServer) MergePullRequest(ctx context.Context, pr scm.PullRequest) error
MergePullRequest Merges a pull request, the pr parameter will always originate from the same package
func (*BitbucketServer) UpdatePullRequest ¶ added in v0.50.0
func (b *BitbucketServer) UpdatePullRequest(_ context.Context, _ scm.Repository, pullReq scm.PullRequest, _ scm.NewPullRequest) (scm.PullRequest, error)
UpdatePullRequest updates an existing pull request
type RepositoryListing ¶
type RepositoryListing struct { Projects []string Users []string Repositories []RepositoryReference }
RepositoryListing contains information about which repositories that should be fetched
type RepositoryReference ¶
RepositoryReference contains information to be able to reference a repository
func ParseRepositoryReference ¶
func ParseRepositoryReference(val string) (RepositoryReference, error)
ParseRepositoryReference parses a GiteaRepository reference from the format "projectKey/repoName"
func (RepositoryReference) String ¶
func (rr RepositoryReference) String() string
String returns the string representation of a repo reference