Documentation ¶
Index ¶
- Constants
- type API
- type Client
- type CommentService
- type CommitsService
- type Config
- type GitHub
- func (g *GitHub) IssuesCreateComment(ctx context.Context, number int, comment *github.IssueComment) (*github.IssueComment, *github.Response, error)
- func (g *GitHub) IssuesDeleteComment(ctx context.Context, commentID int64) (*github.Response, error)
- func (g *GitHub) IssuesListComments(ctx context.Context, number int, opt *github.IssueListCommentsOptions) ([]*github.IssueComment, *github.Response, error)
- func (g *GitHub) RepositoriesCreateComment(ctx context.Context, sha string, comment *github.RepositoryComment) (*github.RepositoryComment, *github.Response, error)
- func (g *GitHub) RepositoriesListCommits(ctx context.Context, opt *github.CommitsListOptions) ([]*github.RepositoryCommit, *github.Response, error)
- type NotifyService
- type PostOptions
- type PullRequest
Constants ¶
const EnvToken = "GITHUB_TOKEN"
EnvToken is GitHub API Token
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { IssuesCreateComment(ctx context.Context, number int, comment *github.IssueComment) (*github.IssueComment, *github.Response, error) IssuesDeleteComment(ctx context.Context, commentID int64) (*github.Response, error) IssuesListComments(ctx context.Context, number int, opt *github.IssueListCommentsOptions) ([]*github.IssueComment, *github.Response, error) RepositoriesCreateComment(ctx context.Context, sha string, comment *github.RepositoryComment) (*github.RepositoryComment, *github.Response, error) RepositoriesListCommits(ctx context.Context, opt *github.CommitsListOptions) ([]*github.RepositoryCommit, *github.Response, error) }
API is GitHub API interface
type Client ¶
type Client struct { *github.Client Debug bool Config Config Comment *CommentService Commits *CommitsService Notify *NotifyService API API // contains filtered or unexported fields }
Client is a API client for GitHub
type CommentService ¶
type CommentService service
CommentService handles communication with the comment related methods of GitHub API
func (*CommentService) Delete ¶
func (g *CommentService) Delete(id int) error
Delete deletes comment on GitHub issues/pull 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) ([]*github.IssueComment, error)
List lists comments on GitHub issues/pull 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 GitHub API
type Config ¶
type Config struct { Token string Owner string Repo string PR PullRequest CI string Parser terraform.Parser Template terraform.Template }
Config is a configuration for GitHub client
type GitHub ¶
GitHub represents the attribute information necessary for requesting GitHub API
func (*GitHub) IssuesCreateComment ¶
func (g *GitHub) IssuesCreateComment(ctx context.Context, number int, comment *github.IssueComment) (*github.IssueComment, *github.Response, error)
IssuesCreateComment is a wrapper of https://godoc.org/github.com/google/go-github/github#IssuesService.CreateComment
func (*GitHub) IssuesDeleteComment ¶
func (g *GitHub) IssuesDeleteComment(ctx context.Context, commentID int64) (*github.Response, error)
IssuesDeleteComment is a wrapper of https://godoc.org/github.com/google/go-github/github#IssuesService.DeleteComment
func (*GitHub) IssuesListComments ¶
func (g *GitHub) IssuesListComments(ctx context.Context, number int, opt *github.IssueListCommentsOptions) ([]*github.IssueComment, *github.Response, error)
IssuesListComments is a wrapper of https://godoc.org/github.com/google/go-github/github#IssuesService.ListComments
func (*GitHub) RepositoriesCreateComment ¶
func (g *GitHub) RepositoriesCreateComment(ctx context.Context, sha string, comment *github.RepositoryComment) (*github.RepositoryComment, *github.Response, error)
RepositoriesCreateComment is a wrapper of https://godoc.org/github.com/google/go-github/github#RepositoriesService.CreateComment
func (*GitHub) RepositoriesListCommits ¶
func (g *GitHub) RepositoriesListCommits(ctx context.Context, opt *github.CommitsListOptions) ([]*github.RepositoryCommit, *github.Response, error)
RepositoriesListCommits is a wrapper of https://godoc.org/github.com/google/go-github/github#RepositoriesService.ListCommits
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
type PullRequest ¶
PullRequest represents GitHub Pull Request metadata
func (*PullRequest) IsNumber ¶
func (pr *PullRequest) IsNumber() bool
IsNumber returns true if PullRequest is Pull Request build