github

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// StatusQueued ...
	StatusQueued = "queued"
	// StatusInProgress ...
	StatusInProgress = "in_progress"
	// StatusCompleted ...
	StatusCompleted = "completed"
)
View Source
const (
	// CIStatusSuccess ...
	CIStatusSuccess = CIStatus("success")
	// CIStatusFailure ...
	CIStatusFailure = CIStatus("failure")
	// CIStatusNeutral ...
	CIStatusNeutral = CIStatus("neutral")
	// CIStatusCancelled ...
	CIStatusCancelled = CIStatus("cancelled")
	// CIStatusTimeout ...
	CIStatusTimeout = CIStatus("timed_out")
)

Variables

This section is empty.

Functions

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

func NewGithubAppClient

func NewGithubAppClient(accessToken, apiServer, proxyAddress string) *github.Client

func UIType

func UIType(pipelineType config.PipelineType) string

Types

type CIStatus

type CIStatus string

CIStatus ...

type CheckService

type CheckService struct {
	// contains filtered or unexported fields
}

CheckService ...

func (*CheckService) CompleteGitCheck

func (s *CheckService) CompleteGitCheck(gitCheckID int64, status CIStatus, check *GitCheck) error

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

func (*CheckService) UpdateGitCheck

func (s *CheckService) UpdateGitCheck(gitCheckID int64, check *GitCheck) error

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

type Client

type Client struct {
	Git               *github.Client
	InstallationToken string
	//Repo              *RepoService
	Checks *CheckService
}

Client ...

func NewDynamicClient

func NewDynamicClient(cfg *Config) (*Client, error)

NewDynamicClient init git client & logger according to user's installation ID

func NewGithubClient

func NewGithubClient(cfg *Config) *Client

NewGithubClient constructor

type Config

type Config struct {
	APIServer string
	ProxyAddr string
	NoCache   bool

	AccessToken string
	HookURL     string
	HookSecret  string

	AppKey         string
	AppID          int
	InstallationID int
}

Config ...

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
}

GitCheck ...

func (*GitCheck) DetailsURL

func (gc *GitCheck) DetailsURL() string

DetailsURL ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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