provider

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {

	// HTTP client used to communicate with the API.
	Client *wrapper

	// Base URL for API requests.
	BaseURL *url.URL

	Repositories       scm.RepositoryService
	Linker             scm.Linker
	Labels             LabelService
	PullRequests       PullRequestService
	PullRequestLabels  PullRequestLabelService
	PullRequestReviews PullRequestReviewService
	PullRequestTests   PullRequestTestService
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config config.Config) (*Client, error)

type Error

type Error struct {
	Message string `json:"message"`
}

Error represents a Gitee error.

func (*Error) Error

func (e *Error) Error() string

type Label

type Label struct {
	Name  string `json:"name"`
	Color string `json:"color"`
}

type LabelService

type LabelService interface {
	// List 仓库任务标签列表
	List(repo string) (*scm.Response, []*Label, error)
	// Get 获取指定任务标签
	Get(repo string, name string) (*scm.Response, *Label, error)
	// Create 创建任务标签
	Create(repo string, in Label) (*scm.Response, *Label, error)
	// Delete 删除任务标签
	Delete(repo string, name string) (*scm.Response, error)
	// Update 更新任务标签
	Update(repo string, name string, in Label) (*scm.Response, *Label, error)
}

type PullRequestLabelService

type PullRequestLabelService interface {
	// List 获取某个 Pull Request 的所有标签
	List(repo string, number int, opts scm.ListOptions) (*scm.Response, []*Label, error)
	// Create 创建 Pull Request 标签
	Create(repo string, number int, names []string) (*scm.Response, []*Label, error)
	// Update 替换 Pull Request 所有标签
	Update(repo string, number int, names []string) (*scm.Response, []*Label, error)
	// Delete 删除 Pull Request 标签
	Delete(repo string, number int, names []string) (*scm.Response, []*Label, error)
}

type PullRequestReviewService

type PullRequestReviewService interface {
	// Pass 处理 Pull Request 审查
	Pass(repo string, number int, force bool) (*scm.Response, error)
	// Reset 重置 Pull Request 审查 的状态
	Reset(repo string, number int, resetAll bool) (*scm.Response, error)
	// AddAssignees 指派用户审查 Pull Request
	AddAssignees(repo string, number int, assignees []string) (*scm.Response, error)
	// DeleteAssignees 取消用户审查 Pull Request
	DeleteAssignees(repo string, number int, assignees []string) (*scm.Response, error)
}

PullRequestReviewService Pull Request 审查

type PullRequestService

type PullRequestService interface {
	scm.PullRequestService
	// UpdateComment 更新pull request 评论
	UpdateComment(repo string, id int, body string) (*scm.Response, error)
}

type PullRequestTestService

type PullRequestTestService interface {
	// Pass 处理 Pull Request 测试
	Pass(repo string, number int, force bool) (*scm.Response, error)
	// Reset 重置 Pull Request 测试 的状态
	Reset(repo string, number int, resetAll bool) (*scm.Response, error)
	// AddTesters 指派用户测试 Pull Request
	AddTesters(repo string, number int, testers []string) (*scm.Response, error)
	// DeleteTesters 取消用户测试 Pull Request
	DeleteTesters(repo string, number int, testers []string) (*scm.Response, error)
}

PullRequestTestService Pull Request 测试

Jump to

Keyboard shortcuts

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