Documentation
¶
Index ¶
- type Comment
- type GitHubAPI
- type MockClient
- func (m *MockClient) CreateIssueComment(owner, repo string, prNumber int, body string) (*Comment, error)
- func (m *MockClient) CreateReviewCommentReply(owner, repo string, commentID int, body string) (*Comment, error)
- func (m *MockClient) FindReviewThreadForComment(owner, repo string, prNumber, commentID int) (string, error)
- func (m *MockClient) ListIssueComments(owner, repo string, prNumber int) ([]Comment, error)
- func (m *MockClient) ListReviewComments(owner, repo string, prNumber int) ([]Comment, error)
- func (m *MockClient) ResolveReviewThread(threadID string) error
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comment ¶
type Comment struct {
ID int `json:"id"`
Body string `json:"body"`
User User `json:"user"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
// Review comment specific fields
Path string `json:"path,omitempty"`
Line int `json:"line,omitempty"`
Position int `json:"position,omitempty"`
// Computed fields
Type string `json:"-"` // "issue" or "review"
}
Comment represents a GitHub comment (issue or review)
type GitHubAPI ¶
type GitHubAPI interface {
// Comment operations
ListIssueComments(owner, repo string, prNumber int) ([]Comment, error)
ListReviewComments(owner, repo string, prNumber int) ([]Comment, error)
CreateIssueComment(owner, repo string, prNumber int, body string) (*Comment, error)
CreateReviewCommentReply(owner, repo string, commentID int, body string) (*Comment, error)
// GraphQL operations
ResolveReviewThread(threadID string) error
FindReviewThreadForComment(owner, repo string, prNumber, commentID int) (string, error)
}
GitHubAPI defines the interface for GitHub API operations
type MockClient ¶
type MockClient struct {
IssueComments []Comment
ReviewComments []Comment
CreatedComment *Comment
ResolvedThread string
// Error simulation
ListIssueCommentsError error
ListReviewCommentsError error
CreateCommentError error
ResolveThreadError error
}
MockClient implements GitHubAPI for testing
func NewMockClient ¶
func NewMockClient() *MockClient
NewMockClient creates a new mock client for testing
func (*MockClient) CreateIssueComment ¶
func (*MockClient) CreateReviewCommentReply ¶
func (*MockClient) FindReviewThreadForComment ¶
func (m *MockClient) FindReviewThreadForComment(owner, repo string, prNumber, commentID int) (string, error)
func (*MockClient) ListIssueComments ¶
func (m *MockClient) ListIssueComments(owner, repo string, prNumber int) ([]Comment, error)
Mock implementations
func (*MockClient) ListReviewComments ¶
func (m *MockClient) ListReviewComments(owner, repo string, prNumber int) ([]Comment, error)
func (*MockClient) ResolveReviewThread ¶
func (m *MockClient) ResolveReviewThread(threadID string) error
Click to show internal directories.
Click to hide internal directories.