gitlab

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 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 MergeRequestCommitCommenter

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

MergeRequestCommitCommenter 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) (*MergeRequestCommitCommenter, error)

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

func (*MergeRequestCommitCommenter) Flush

Flush posts comments which has not been posted yet.

func (*MergeRequestCommitCommenter) Post

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

type MergeRequestDiff

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

MergeRequestDiff is a diff service for GitLab MergeRequest.

func NewGitLabMergeRequestDiff

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

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

func (*MergeRequestDiff) Diff

func (g *MergeRequestDiff) 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 (*MergeRequestDiff) Strip

func (g *MergeRequestDiff) Strip() int

Strip returns 1 as a strip of git diff.

type MergeRequestDiscussionCommenter

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

MergeRequestDiscussionCommenter 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) (*MergeRequestDiscussionCommenter, error)

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

func (*MergeRequestDiscussionCommenter) Flush

Flush posts comments which has not been posted yet.

func (*MergeRequestDiscussionCommenter) 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