Documentation ¶
Index ¶
- Constants
- type API
- type Client
- type CommentService
- type CommitsService
- type Config
- type GitLab
- func (g *GitLab) CreateMergeRequestNote(mergeRequest int, opt *gitlab.CreateMergeRequestNoteOptions, ...) (*gitlab.Note, *gitlab.Response, error)
- func (g *GitLab) DeleteMergeRequestNote(mergeRequest, note int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error)
- func (g *GitLab) ListCommits(opt *gitlab.ListCommitsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Commit, *gitlab.Response, error)
- func (g *GitLab) ListMergeRequestNotes(mergeRequest int, opt *gitlab.ListMergeRequestNotesOptions, ...) ([]*gitlab.Note, *gitlab.Response, error)
- func (g *GitLab) PostCommitComment(sha string, opt *gitlab.PostCommitCommentOptions, ...) (*gitlab.CommitComment, *gitlab.Response, error)
- type MergeRequest
- type NotifyService
- type PostOptions
Constants ¶
const EnvBaseURL = "GITLAB_BASE_URL"
EnvBaseURL is GitLab base URL. This can be set to a domain endpoint to use with Private GitLab.
const EnvToken = "GITLAB_TOKEN"
EnvToken is GitLab API Token
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { CreateMergeRequestNote(mergeRequest int, opt *gitlab.CreateMergeRequestNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error) DeleteMergeRequestNote(mergeRequest, note int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error) ListMergeRequestNotes(mergeRequest int, opt *gitlab.ListMergeRequestNotesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error) PostCommitComment(sha string, opt *gitlab.PostCommitCommentOptions, options ...gitlab.RequestOptionFunc) (*gitlab.CommitComment, *gitlab.Response, error) ListCommits(opt *gitlab.ListCommitsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Commit, *gitlab.Response, error) }
API is GitLab API interface
type Client ¶
type Client struct { *gitlab.Client Debug bool Config Config Comment *CommentService Commits *CommitsService Notify *NotifyService API API // contains filtered or unexported fields }
Client ...
type CommentService ¶
type CommentService service
CommentService handles communication with the comment related methods of GitLab API
func (*CommentService) Delete ¶
func (g *CommentService) Delete(note int) error
Delete deletes comment on GitLab merge requests
func (*CommentService) DeleteDuplicates ¶
func (g *CommentService) DeleteDuplicates(title string)
DeleteDuplicates deletes duplicate comments containing arbitrary character strings
func (*CommentService) List ¶
func (g *CommentService) List(number int) ([]*gitlab.Note, error)
List lists comments on GitLab merge requests
func (*CommentService) Post ¶
func (g *CommentService) Post(body string, opt PostOptions) error
Post posts comment
type CommitsService ¶
type CommitsService service
CommitsService handles communication with the commits related methods of GitLab API
type Config ¶
type Config struct { Token string BaseURL string NameSpace string Project string MR MergeRequest CI string Parser terraform.Parser Template terraform.Template }
Config is a configuration for GitHub client
type GitLab ¶
GitLab represents the attribute information necessary for requesting GitLab API
func (*GitLab) CreateMergeRequestNote ¶
func (g *GitLab) CreateMergeRequestNote(mergeRequest int, opt *gitlab.CreateMergeRequestNoteOptions, options ...gitlab.RequestOptionFunc) (*gitlab.Note, *gitlab.Response, error)
CreateMergeRequestNote is a wrapper of https://godoc.org/github.com/xanzy/go-gitlab#NotesService.CreateMergeRequestNote
func (*GitLab) DeleteMergeRequestNote ¶
func (g *GitLab) DeleteMergeRequestNote(mergeRequest, note int, options ...gitlab.RequestOptionFunc) (*gitlab.Response, error)
DeleteMergeRequestNote is a wrapper of https://godoc.org/github.com/xanzy/go-gitlab#NotesService.DeleteMergeRequestNote
func (*GitLab) ListCommits ¶
func (g *GitLab) ListCommits(opt *gitlab.ListCommitsOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Commit, *gitlab.Response, error)
ListCommits is a wrapper of https://godoc.org/github.com/xanzy/go-gitlab#CommitsService.ListCommits
func (*GitLab) ListMergeRequestNotes ¶
func (g *GitLab) ListMergeRequestNotes(mergeRequest int, opt *gitlab.ListMergeRequestNotesOptions, options ...gitlab.RequestOptionFunc) ([]*gitlab.Note, *gitlab.Response, error)
ListMergeRequestNotes is a wrapper of https://godoc.org/github.com/xanzy/go-gitlab#NotesService.ListMergeRequestNotes
func (*GitLab) PostCommitComment ¶
func (g *GitLab) PostCommitComment(sha string, opt *gitlab.PostCommitCommentOptions, options ...gitlab.RequestOptionFunc) (*gitlab.CommitComment, *gitlab.Response, error)
PostCommitComment is a wrapper of https://godoc.org/github.com/xanzy/go-gitlab#CommitsService.PostCommitComment
type MergeRequest ¶
MergeRequest represents GitLab Merge Request metadata
func (*MergeRequest) IsNumber ¶
func (mr *MergeRequest) IsNumber() bool
IsNumber returns true if MergeRequest is Merge Request build
type NotifyService ¶
type NotifyService service
NotifyService handles communication with the notification related methods of GitHub API
type PostOptions ¶
PostOptions specifies the optional parameters to post comments to a pull request