Documentation
¶
Index ¶
- func DetectRemoteType(remoteURL, authToken string) (string, error)
- type ClientInterface
- type Comment
- type CreateIssueArgs
- type CreateIssueWithAttachmentsArgs
- type CreatePullRequestArgs
- type CreatePullRequestCommentArgs
- type EditIssueArgs
- type EditIssueCommentArgs
- type EditPullRequestArgs
- type EditPullRequestCommentArgs
- type FileContentFetcher
- type Issue
- type IssueAttachmentCreator
- type IssueCommentEditor
- type IssueCommentList
- type IssueCommentLister
- type IssueCommenter
- type IssueCreator
- type IssueEditor
- type IssueLister
- type ListIssueCommentsArgs
- type ListPullRequestCommentsArgs
- type ListPullRequestsOptions
- type ProcessedAttachment
- type PullRequest
- type PullRequestBranch
- type PullRequestCommentEditor
- type PullRequestCommentList
- type PullRequestCommentLister
- type PullRequestCommenter
- type PullRequestCreator
- type PullRequestEditor
- type PullRequestLister
- type VersionResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectRemoteType ¶
DetectRemoteType detects whether a remote server is Forgejo or Gitea by calling the /api/v1/version endpoint and parsing the response
Types ¶
type ClientInterface ¶
type ClientInterface interface {
IssueLister
IssueCommenter
IssueCommentLister
IssueCommentEditor
IssueCreator
IssueAttachmentCreator
IssueEditor
PullRequestLister
PullRequestCommentLister
PullRequestCommenter
PullRequestCommentEditor
PullRequestEditor
PullRequestCreator
FileContentFetcher
}
ClientInterface combines IssueLister, IssueCommenter, IssueCommentLister, IssueCommentEditor, IssueCreator, IssueAttachmentCreator, IssueEditor, PullRequestLister, PullRequestCommentLister, PullRequestCommenter, PullRequestCommentEditor, PullRequestEditor, PullRequestCreator, and FileContentFetcher for complete Git operations
type Comment ¶
type Comment struct {
ID int `json:"id"`
Content string `json:"body"`
Author string `json:"user"`
Created string `json:"created"`
Updated string `json:"updated"`
}
Comment represents a comment on a Git repository issue or pull request
type CreateIssueArgs ¶
type CreateIssueArgs struct {
Repository string `json:"repository"`
Title string `json:"title"`
Body string `json:"body"`
}
CreateIssueArgs represents arguments for creating a new issue
type CreateIssueWithAttachmentsArgs ¶
type CreateIssueWithAttachmentsArgs struct {
CreateIssueArgs
Attachments []ProcessedAttachment
}
CreateIssueWithAttachmentsArgs represents arguments for creating a new issue with attachments
type CreatePullRequestArgs ¶
type CreatePullRequestArgs struct {
Repository string `json:"repository"`
Head string `json:"head"` // Source branch
Base string `json:"base"` // Target branch
Title string `json:"title"`
Body string `json:"body"`
Draft bool `json:"draft"`
Assignee string `json:"assignee"` // Single reviewer
}
CreatePullRequestArgs represents arguments for creating a new pull request
type CreatePullRequestCommentArgs ¶
type CreatePullRequestCommentArgs struct {
Repository string `json:"repository"`
PullRequestNumber int `json:"pull_request_number"`
Comment string `json:"comment"`
}
CreatePullRequestCommentArgs represents the arguments for creating a pull request comment
type EditIssueArgs ¶
type EditIssueArgs struct {
Repository string `json:"repository"`
Directory string `json:"directory"`
IssueNumber int `json:"issue_number"`
Title string `json:"title"`
Body string `json:"body"`
State string `json:"state"`
}
EditIssueArgs represents the arguments for editing an issue
type EditIssueCommentArgs ¶
type EditIssueCommentArgs struct {
Repository string `json:"repository"`
IssueNumber int `json:"issue_number"`
CommentID int `json:"comment_id"`
NewContent string `json:"new_content"`
}
EditIssueCommentArgs represents the arguments for editing an issue comment
type EditPullRequestArgs ¶
type EditPullRequestArgs struct {
Repository string `json:"repository"`
Directory string `json:"directory"`
PullRequestNumber int `json:"pull_request_number"`
Title string `json:"title"`
Body string `json:"body"`
State string `json:"state"`
BaseBranch string `json:"base_branch"`
}
EditPullRequestArgs represents the arguments for editing a pull request
type EditPullRequestCommentArgs ¶
type EditPullRequestCommentArgs struct {
Repository string `json:"repository"`
PullRequestNumber int `json:"pull_request_number"`
CommentID int `json:"comment_id"`
NewContent string `json:"new_content"`
}
EditPullRequestCommentArgs represents the arguments for editing a pull request comment
type FileContentFetcher ¶
type FileContentFetcher interface {
GetFileContent(ctx context.Context, owner, repo, ref, filepath string) ([]byte, error)
}
FileContentFetcher defines interface for fetching repository file contents
type Issue ¶
type Issue struct {
ID int `json:"id"`
Number int `json:"number"`
Title string `json:"title"`
State string `json:"state"`
Body string `json:"body,omitempty"`
User string `json:"user"`
Updated string `json:"updated,omitempty"`
Created string `json:"created,omitempty"`
}
Issue represents a Git repository issue
type IssueAttachmentCreator ¶
type IssueAttachmentCreator interface {
CreateIssueWithAttachments(ctx context.Context, args CreateIssueWithAttachmentsArgs) (*Issue, error)
}
IssueAttachmentCreator defines the interface for creating issues with attachments
type IssueCommentEditor ¶
type IssueCommentEditor interface {
EditIssueComment(ctx context.Context, args EditIssueCommentArgs) (*Comment, error)
}
IssueCommentEditor defines the interface for editing comments on Git repository issues
type IssueCommentList ¶
type IssueCommentList struct {
Comments []Comment `json:"comments"`
Total int `json:"total"`
Limit int `json:"limit"`
Offset int `json:"offset"`
}
IssueCommentList represents a collection of comments with pagination metadata
type IssueCommentLister ¶
type IssueCommentLister interface {
ListIssueComments(ctx context.Context, repo string, issueNumber int, limit, offset int) (*IssueCommentList, error)
}
IssueCommentLister defines the interface for listing comments from Git repository issues
type IssueCommenter ¶
type IssueCommenter interface {
CreateIssueComment(ctx context.Context, repo string, issueNumber int, comment string) (*Comment, error)
}
IssueCommenter defines the interface for creating comments on Git repository issues
type IssueCreator ¶
type IssueCreator interface {
CreateIssue(ctx context.Context, args CreateIssueArgs) (*Issue, error)
}
IssueCreator defines the interface for creating issues
type IssueEditor ¶
type IssueEditor interface {
EditIssue(ctx context.Context, args EditIssueArgs) (*Issue, error)
}
IssueEditor defines the interface for editing issues in Git repositories
type IssueLister ¶
type IssueLister interface {
ListIssues(ctx context.Context, repo string, limit, offset int) ([]Issue, error)
}
IssueLister defines the interface for listing issues from a Git repository
type ListIssueCommentsArgs ¶
type ListIssueCommentsArgs struct {
Repository string `json:"repository"`
IssueNumber int `json:"issue_number"`
Limit int `json:"limit"`
Offset int `json:"offset"`
}
ListIssueCommentsArgs represents the arguments for listing issue comments
type ListPullRequestCommentsArgs ¶
type ListPullRequestCommentsArgs struct {
Repository string `json:"repository"`
PullRequestNumber int `json:"pull_request_number"`
Limit int `json:"limit"`
Offset int `json:"offset"`
}
ListPullRequestCommentsArgs represents the arguments for listing pull request comments
type ListPullRequestsOptions ¶
type ListPullRequestsOptions struct {
State string `json:"state"`
Limit int `json:"limit"`
Offset int `json:"offset"`
}
ListPullRequestsOptions represents the options for listing pull requests
type ProcessedAttachment ¶
ProcessedAttachment represents a processed file attachment
type PullRequest ¶
type PullRequest struct {
ID int `json:"id"`
Number int `json:"number"`
Title string `json:"title"`
Body string `json:"body"`
State string `json:"state"`
User string `json:"user"`
CreatedAt string `json:"created"`
UpdatedAt string `json:"updated"`
Head PullRequestBranch `json:"head"`
Base PullRequestBranch `json:"base"`
}
PullRequest represents a Git repository pull request
type PullRequestBranch ¶
PullRequestBranch represents a branch reference in a pull request
type PullRequestCommentEditor ¶
type PullRequestCommentEditor interface {
EditPullRequestComment(ctx context.Context, args EditPullRequestCommentArgs) (*Comment, error)
}
PullRequestCommentEditor defines the interface for editing comments on Git repository pull requests
type PullRequestCommentList ¶
type PullRequestCommentList struct {
Comments []Comment `json:"comments"`
Total int `json:"total"`
Limit int `json:"limit"`
Offset int `json:"offset"`
}
PullRequestCommentList represents a collection of pull request comments with pagination metadata
type PullRequestCommentLister ¶
type PullRequestCommentLister interface {
ListPullRequestComments(ctx context.Context, repo string, pullRequestNumber int, limit, offset int) (*PullRequestCommentList, error)
}
PullRequestCommentLister defines the interface for listing comments from Git repository pull requests
type PullRequestCommenter ¶
type PullRequestCommenter interface {
CreatePullRequestComment(ctx context.Context, repo string, pullRequestNumber int, comment string) (*Comment, error)
}
PullRequestCommenter defines the interface for creating comments on Git repository pull requests
type PullRequestCreator ¶
type PullRequestCreator interface {
CreatePullRequest(ctx context.Context, args CreatePullRequestArgs) (*PullRequest, error)
}
PullRequestCreator defines the interface for creating pull requests
type PullRequestEditor ¶
type PullRequestEditor interface {
EditPullRequest(ctx context.Context, args EditPullRequestArgs) (*PullRequest, error)
}
PullRequestEditor defines the interface for editing pull requests in Git repositories
type PullRequestLister ¶
type PullRequestLister interface {
ListPullRequests(ctx context.Context, repo string, options ListPullRequestsOptions) ([]PullRequest, error)
}
PullRequestLister defines the interface for listing pull requests from a Git repository
type VersionResponse ¶
type VersionResponse struct {
Version string `json:"version"`
}
VersionResponse represents the response from the /api/v1/version endpoint