Documentation
¶
Index ¶
- type Branch
- type GitRepoReader
- func (reader *GitRepoReader) Clone(ctx context.Context, req *pb.SyncRequest) (*pb.SyncResponse, error)
- func (reader *GitRepoReader) CreateWorkTree(ctx context.Context, req *pb.WorkTreeRequest) (*pb.SyncResponse, error)
- func (reader *GitRepoReader) Fetch(ctx context.Context, req *pb.SyncRequest) (*pb.SyncResponse, error)
- func (reader *GitRepoReader) RemoveWorkTree(ctx context.Context, req *pb.WorkTreeRequest) (*pb.SyncResponse, error)
- type PullRequest
- type PullRequestPayload
- type Repo
- type Repository
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Branch ¶
type Branch struct {
Ref string `json:"ref"` // branch name
SHA string `json:"sha"` // commit SHA of branch head
Repo Repo `json:"repo"` // repository the branch belongs to
}
Branch represents a branch in a repository
type GitRepoReader ¶
type GitRepoReader struct {
}
func (*GitRepoReader) Clone ¶
func (reader *GitRepoReader) Clone(ctx context.Context, req *pb.SyncRequest) (*pb.SyncResponse, error)
Clone clones the repository to the specified directory. this is usually called when an incoming event is received. if the repository is private, you need to specify a tokoen.
func (*GitRepoReader) CreateWorkTree ¶
func (reader *GitRepoReader) CreateWorkTree(ctx context.Context, req *pb.WorkTreeRequest) (*pb.SyncResponse, error)
CreateWorkTree creates a worktree in the repository.
func (*GitRepoReader) Fetch ¶
func (reader *GitRepoReader) Fetch(ctx context.Context, req *pb.SyncRequest) (*pb.SyncResponse, error)
Fetch fetches the remote origin of the repository. it relies on the remote origin being set in the repository reader.
func (*GitRepoReader) RemoveWorkTree ¶
func (reader *GitRepoReader) RemoveWorkTree(ctx context.Context, req *pb.WorkTreeRequest) (*pb.SyncResponse, error)
RemoveWorkTree removes a worktree from the repository.
type PullRequest ¶
type PullRequest struct {
ID int `json:"id"`
Title string `json:"title"`
User User `json:"user"` // who opened the PR
OriginBranch Branch `json:"head"` // source branch
TargetBranch Branch `json:"base"` // target branch
}
PullRequest contains the details about the PR itself
type PullRequestPayload ¶
type PullRequestPayload struct {
Action string `json:"action"` // opened, closed, synchronize, etc.
Number int `json:"number"` // PR number in the repo
Sender User `json:"sender"` // Github user
PullRequest PullRequest `json:"pull_request"`
Repository Repository `json:"repository"`
}
PullRequestPayload represents the GitHub webhook payload for pull requests
type Repo ¶
type Repo struct {
Name string `json:"name"`
CloneURL string `json:"clone_url"` // URL to clone repo
Owner User `json:"owner"` // repo owner
}
Repo represents a GitHub repository
type Repository ¶
type Repository struct {
Name string `json:"name"`
}
Repository represents the target repository where PR is opened