github

package
v1.0.30 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCommentNotFound = errors.New("comment not found")

Functions

This section is empty.

Types

type Client

type Client struct {
	Issue *Issue
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, url *url.URL, token string, client *http.Client) *Client

NewGitHubClient creates a new GitHubClient instance that wraps the provided GitHub API client. The GitHubClient provides a higher-level interface for interacting with the GitHub API, including methods for managing GitHub issues.

type Issue

type Issue struct {
	Opt IssueOptions
	// contains filtered or unexported fields
}

func (*Issue) AddComment

func (i *Issue) AddComment(ctx context.Context) (*github.IssueComment, error)

AddComment adds a new comment or updates an existing comment on a GitHub issue. If the Update field is true, it will append a unique identifier to the comment body and attempt to find and update the existing comment with that identifier. Otherwise, it will create a new comment on the issue.

func (*Issue) FindComment

func (i *Issue) FindComment(ctx context.Context) (*github.IssueComment, error)

FindComment returns the GitHub issue comment that contains the specified key, or nil if no such comment exists. It retrieves all comments on the issue and searches for one that contains the specified key in the comment body.

type IssueOptions

type IssueOptions struct {
	Number  int
	Message string
	Key     string
	Repo    string
	Owner   string
	Update  bool
}

type IssueService

type IssueService interface {
	CreateComment(ctx context.Context, owner, repo string, number int, comment *github.IssueComment) (*github.IssueComment, *github.Response, error)
	EditComment(ctx context.Context, owner, repo string, commentID int64, comment *github.IssueComment) (*github.IssueComment, *github.Response, error)
	ListComments(ctx context.Context, owner, repo string, number int, opts *github.IssueListCommentsOptions) ([]*github.IssueComment, *github.Response, error)
}

APIClient is an interface that wraps the GitHub API client.

type IssueServiceImpl

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

func (*IssueServiceImpl) CreateComment

func (s *IssueServiceImpl) CreateComment(ctx context.Context, owner, repo string, number int, comment *github.IssueComment) (*github.IssueComment, *github.Response, error)

CreateComment wraps the CreateComment method of the github.IssuesService.

func (*IssueServiceImpl) EditComment

func (s *IssueServiceImpl) EditComment(ctx context.Context, owner, repo string, commentID int64, comment *github.IssueComment) (*github.IssueComment, *github.Response, error)

EditComment wraps the EditComment method of the github.IssuesService.

func (*IssueServiceImpl) ListComments

func (s *IssueServiceImpl) ListComments(ctx context.Context, owner, repo string, number int, opts *github.IssueListCommentsOptions) ([]*github.IssueComment, *github.Response, error)

ListComments wraps the ListComments method of the github.IssuesService.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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