github

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: Apache-2.0 Imports: 9 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"
	CIStatusTimeout   CIStatus = "timed_out"
	CIStatusError     CIStatus = "error"
)

type Client

type Client struct {
	*github.Client
}

func GetGithubAppClientByOwner added in v1.2.0

func GetGithubAppClientByOwner(appID int, appKey, owner, proxy 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) 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
	DisplayName string
	ProductName string
	PipeType    config.PipelineType
	TaskID      int64
	TestReports []*types.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
	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