Documentation ¶
Index ¶
- func CreateIssue(login *config.Login, repoOwner, repoName string, opts gitea.CreateIssueOption) error
- func CreateLogin(name, token, user, passwd, sshKey, giteaURL string, insecure bool) error
- func CreateMilestone(login *config.Login, repoOwner, repoName, title, description string, ...) error
- func CreatePull(login *config.Login, repoOwner, repoName, base, head string, ...) error
- func CreatePullReview(ctx *context.TeaContext, idx int64, status gitea.ReviewStateType, ...) error
- func GenerateLoginName(url, user string) (string, error)
- func GetDefaultPRBase(login *config.Login, owner, repo string) (string, error)
- func GetDefaultPRHead(localRepo *local_git.TeaRepo) (owner, branch string, err error)
- func GetDefaultPRTitle(head string) string
- func GetHeadSpec(owner, branch, baseOwner string) string
- func LabelsExport(labels []*gitea.Label, path string) error
- func OpenFileInEditor(filename string) error
- func ParseDiffComments(diffFile string) ([]gitea.CreatePullReviewComment, error)
- func PullCheckout(login *config.Login, repoOwner, repoName string, forceCreateBranch bool, ...) error
- func PullClean(login *config.Login, repoOwner, repoName string, index int64, ignoreSHA bool, ...) error
- func ResolveLabelNames(client *gitea.Client, owner, repo string, labelNames []string) ([]int64, error)
- func SavePullDiff(ctx *context.TeaContext, idx int64) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateIssue ¶
func CreateIssue(login *config.Login, repoOwner, repoName string, opts gitea.CreateIssueOption) error
CreateIssue creates an issue in the given repo and prints the result
func CreateLogin ¶
CreateLogin create a login to be stored in config
func CreateMilestone ¶
func CreateMilestone(login *config.Login, repoOwner, repoName, title, description string, deadline *time.Time, state gitea.StateType) error
CreateMilestone creates a milestone in the given repo and prints the result
func CreatePull ¶
func CreatePull(login *config.Login, repoOwner, repoName, base, head string, opts *gitea.CreateIssueOption) error
CreatePull creates a PR in the given repo and prints the result
func CreatePullReview ¶
func CreatePullReview(ctx *context.TeaContext, idx int64, status gitea.ReviewStateType, comment string, codeComments []gitea.CreatePullReviewComment) error
CreatePullReview submits a review for a PR
func GenerateLoginName ¶
GenerateLoginName generates a name string based on instance URL & adds username if the result is not unique
func GetDefaultPRBase ¶
GetDefaultPRBase retrieves the default base branch for the given repo
func GetDefaultPRHead ¶
GetDefaultPRHead uses the currently checked out branch, tries to find a remote that has a branch with the same name, and extracts the owner from its URL. If no remote matches, owner is empty, meaning same as head repo owner.
func GetDefaultPRTitle ¶
GetDefaultPRTitle transforms a string like a branchname to a readable text
func GetHeadSpec ¶
GetHeadSpec creates a head string as expected by gitea API
func LabelsExport ¶
LabelsExport save list of labels to disc
func OpenFileInEditor ¶
OpenFileInEditor opens filename in a text editor, and blocks until the editor terminates.
func ParseDiffComments ¶
func ParseDiffComments(diffFile string) ([]gitea.CreatePullReviewComment, error)
ParseDiffComments reads a diff, extracts comments from it & returns them in a gitea compatible struct
func PullCheckout ¶
func PullCheckout( login *config.Login, repoOwner, repoName string, forceCreateBranch bool, index int64, callback func(string) (string, error), ) error
PullCheckout checkout current workdir to the head branch of specified pull request
func PullClean ¶
func PullClean(login *config.Login, repoOwner, repoName string, index int64, ignoreSHA bool, callback func(string) (string, error)) error
PullClean deletes local & remote feature-branches for a closed pull
func ResolveLabelNames ¶
func ResolveLabelNames(client *gitea.Client, owner, repo string, labelNames []string) ([]int64, error)
ResolveLabelNames returns a list of label IDs for a given list of label names
func SavePullDiff ¶
func SavePullDiff(ctx *context.TeaContext, idx int64) (string, error)
SavePullDiff fetches the diff of a pull request and stores it as a temporary file. The path to the file is returned.
Types ¶
This section is empty.