github

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusQueued     = "queued"
	StatusInProgress = "in_progress"
	StatusCompleted  = "completed"
)
View Source
const (
	StateError   = "error"
	StateFailure = "failure"
	StatePending = "pending"
	StateSuccess = "success"
)

Variables

This section is empty.

Functions

func GetTaskLink(baseURI, productName, pipelineName string, pipelineType config.PipelineType, taskID int64) string

func UIType

func UIType(pipelineType config.PipelineType) string

Types

type CIStatus

type CIStatus string
const (
	CIStatusSuccess   CIStatus = "success"
	CIStatusFailure   CIStatus = "failure"
	CIStatusNeutral   CIStatus = "neutral"
	CIStatusCancelled CIStatus = "cancelled"
	CIStatusTimeout   CIStatus = "timed_out"
)

type Client

type Client struct {
	*github.Client
}

func GetGithubAppClientByOwner added in v1.2.0

func GetGithubAppClientByOwner(owner string) (*Client, error)

func NewClient added in v1.2.0

func NewClient(accessToken, proxyAddress string) *Client

func (*Client) CompleteGitCheck added in v1.2.0

func (c *Client) CompleteGitCheck(gitCheckID int64, status CIStatus, check *GitCheck) error

https://developer.github.com/v3/checks/runs/#update-a-check-run

func (*Client) CreateWebHook added in v1.2.0

func (c *Client) CreateWebHook(owner, repo string) (string, error)

func (*Client) DeleteWebHook added in v1.2.0

func (c *Client) DeleteWebHook(owner, repo, hookID string) error

func (*Client) GetFileContent added in v1.5.0

func (c *Client) GetFileContent(owner, repo, path, branch string) ([]byte, error)

func (*Client) GetLatestRepositoryCommit added in v1.4.0

func (c *Client) GetLatestRepositoryCommit(owner, repo, path, branch string) (*git.RepositoryCommit, error)

func (*Client) GetTree added in v1.4.0

func (c *Client) GetTree(owner, repo, path, branch string) ([]*git.TreeNode, error)

func (*Client) GetTreeContents added in v1.4.0

func (c *Client) GetTreeContents(owner, repo, path, branch string) (afero.Fs, error)

func (*Client) GetYAMLContents added in v1.4.0

func (c *Client) GetYAMLContents(owner, repo, path, branch string, isDir, split bool) ([]string, error)

func (*Client) RefreshWebHookSecret added in v1.7.0

func (c *Client) RefreshWebHookSecret(secret, owner, repo, hookID string) error

func (*Client) StartGitCheck added in v1.2.0

func (c *Client) StartGitCheck(check *GitCheck) (int64, error)

https://developer.github.com/v3/checks/runs/#create-a-check-run

func (*Client) UpdateCheckStatus added in v1.2.0

func (c *Client) UpdateCheckStatus(opt *StatusOptions) error

func (*Client) UpdateGitCheck added in v1.2.0

func (c *Client) UpdateGitCheck(gitCheckID int64, check *GitCheck) error

https://developer.github.com/v3/checks/runs/#update-a-check-run

type GitCheck

type GitCheck struct {
	Owner  string
	Repo   string
	Branch string // The name of the branch to perform a check against. (Required.)
	Ref    string // The SHA of the commit. (Required.)
	IsPr   bool

	AslanURL    string
	PipeName    string
	ProductName string
	PipeType    config.PipelineType
	TaskID      int64
	TestReports []*commonmodels.TestSuite
}

func (*GitCheck) DetailsURL

func (gc *GitCheck) DetailsURL() string

DetailsURL ...

type StatusOptions added in v1.2.0

type StatusOptions struct {
	Owner       string
	Repo        string
	Ref         string
	State       string
	Description string

	AslanURL    string
	PipeName    string
	ProductName string
	PipeType    config.PipelineType
	TaskID      int64
}

Jump to

Keyboard shortcuts

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