github

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 14 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, displayName 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"
	CIStatusRejected  CIStatus = "rejected"
	CIStatusTimeout   CIStatus = "timed_out"
	CIStatusError     CIStatus = "error"
)

type Client

type Client struct {
	*github.Client
}

func GetGithubAppClientByOwner

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

func NewClient

func NewClient(accessToken, proxyAddress string, enableProxy bool) *Client

func (*Client) CompleteGitCheck

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

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

func (*Client) DeleteWebHook

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

func (*Client) GetFileContent

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

func (*Client) GetLatestRepositoryCommit

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

func (*Client) GetTree

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

func (*Client) GetTreeContents

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

func (*Client) GetYAMLContents

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

func (*Client) RefreshWebHookSecret

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

func (*Client) UpdateCheckStatus

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

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
	DisplayName string
	ProductName string
	PipeType    config.PipelineType
	TaskID      int64
	TestReports []*commonmodels.TestSuite
}

func (*GitCheck) DetailsURL

func (gc *GitCheck) DetailsURL() string

DetailsURL ...

type StatusOptions

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

	AslanURL    string
	PipeName    string
	DisplayName 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