gitlab

package
v0.10.1-0...-928943b Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitLabMergeRequestCommitCommenter

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

GitLabMergeRequestCommitCommenter is a comment service for GitLab MergeRequest.

API:

https://docs.gitlab.com/ce/api/commits.html#post-comment-to-commit
POST /projects/:id/repository/commits/:sha/comments

func NewGitLabMergeRequestCommitCommenter

func NewGitLabMergeRequestCommitCommenter(cli *gitlab.Client, owner, repo string, pr int, sha string) (*GitLabMergeRequestCommitCommenter, error)

NewGitLabMergeRequestCommitCommenter returns a new GitLabMergeRequestCommitCommenter service. GitLabMergeRequestCommitCommenter service needs git command in $PATH.

func (*GitLabMergeRequestCommitCommenter) Flush

Flush posts comments which has not been posted yet.

func (*GitLabMergeRequestCommitCommenter) Post

Post accepts a comment and holds it. Flush method actually posts comments to GitLab in parallel.

type GitLabMergeRequestDiff

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

GitLabMergeRequestDiff is a diff service for GitLab MergeRequest.

func NewGitLabMergeRequestDiff

func NewGitLabMergeRequestDiff(cli *gitlab.Client, owner, repo string, pr int, sha string) (*GitLabMergeRequestDiff, error)

NewGitLabMergeRequestDiff returns a new GitLabMergeRequestDiff service. itLabMergeRequestDiff service needs git command in $PATH.

func (*GitLabMergeRequestDiff) Diff

func (g *GitLabMergeRequestDiff) Diff(ctx context.Context) ([]byte, error)

Diff returns a diff of MergeRequest. It runs `git diff` locally instead of diff_url of GitLab Merge Request because diff of diff_url is not suited for comment API in a sense that diff of diff_url is equivalent to `git diff --no-renames`, we want diff which is equivalent to `git diff --find-renames`.

func (*GitLabMergeRequestDiff) Strip

func (g *GitLabMergeRequestDiff) Strip() int

Strip returns 1 as a strip of git diff.

type GitLabMergeRequestDiscussionCommenter

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

GitLabMergeRequestDiscussionCommenter is a comment and diff service for GitLab MergeRequest.

API:

https://docs.gitlab.com/ee/api/discussions.html#create-new-merge-request-discussion
POST /projects/:id/merge_requests/:merge_request_iid/discussions

func NewGitLabMergeRequestDiscussionCommenter

func NewGitLabMergeRequestDiscussionCommenter(cli *gitlab.Client, owner, repo string, pr int, sha string) (*GitLabMergeRequestDiscussionCommenter, error)

NewGitLabMergeRequestDiscussionCommenter returns a new GitLabMergeRequestDiscussionCommenter service. GitLabMergeRequestDiscussionCommenter service needs git command in $PATH.

func (*GitLabMergeRequestDiscussionCommenter) Flush

Flush posts comments which has not been posted yet.

func (*GitLabMergeRequestDiscussionCommenter) Post

Post accepts a comment and holds it. Flush method actually posts comments to GitLab in parallel.

Jump to

Keyboard shortcuts

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