github

package
v0.0.0-...-0070b8b Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthInfo

type AuthInfo struct {
	InstallationID int64
	AppID          int64
	PrivateKey     []byte

	GithubToken string
}

type CIStatus

type CIStatus uint
const (
	CIStatusPassed CIStatus = iota
	CIStatusFailed
	CIStatusPending
	CIStatusUnknown
)

func (CIStatus) String

func (c CIStatus) String() string

type CheckCIStatus

type CheckCIStatus interface {
	CheckOverallCIStatus
	CheckCIStatusForChecks
}

type CheckCIStatusForChecks

type CheckCIStatusForChecks interface {
	GetCIStatusForChecks(ctx context.Context, owner, repo string, commitHash string, checkNames []string) (CIStatus, []string, error)
}

type CheckOverallCIStatus

type CheckOverallCIStatus interface {
	GetCIStatus(ctx context.Context, owner, repo string, commitHash string) (CIStatus, error)
}

type CheckPRMerged

type CheckPRMerged interface {
	IsPRMergedOrClosed(ctx context.Context, owner, repo string, pr int) (string, bool, int64, error)
}

type GHClient

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

func AuthenticateWithApp

func AuthenticateWithApp(ctx context.Context, privateKey []byte, appID, installationID int64) (GHClient, error)

AuthenticateWithApp authenticates with a GitHub App

func AuthenticateWithToken

func AuthenticateWithToken(ctx context.Context, token string) GHClient

AuthenticateWithToken authenticates with a GitHub token

func NewGithubClient

func NewGithubClient(ctx context.Context, authInfo AuthInfo) (GHClient, error)

func (GHClient) GetCIStatus

func (c GHClient) GetCIStatus(ctx context.Context, owner, repoName string, ref string) (CIStatus, error)

func (GHClient) GetCIStatusForChecks

func (c GHClient) GetCIStatusForChecks(ctx context.Context, owner, repoName string, ref string, checkNames []string) (CIStatus, []string, error)

GetCIStatusForCheck returns the CI status for a specific commit. It looks at both 'checks' and 'statuses'.

func (GHClient) GetPRHeadSHA

func (c GHClient) GetPRHeadSHA(ctx context.Context, owner, repo string, prNumber int) (string, error)

func (GHClient) IsPRMergedOrClosed

func (c GHClient) IsPRMergedOrClosed(ctx context.Context, owner, repo string, prNumber int) (string, bool, int64, error)

type GetPRHeadSHA

type GetPRHeadSHA interface {
	GetPRHeadSHA(ctx context.Context, owner, repo string, pr int) (string, error)
}

Jump to

Keyboard shortcuts

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