utils

package
v0.0.0-...-1e88db8 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: Apache-2.0 Imports: 15 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGithubClient

func GetGithubClient(gh GithubClientProvider, installationId int64, repoFullName string) (*github.Client, *string, error)

func GetGithubHostname

func GetGithubHostname() string

func GetGithubService

func GetGithubService(gh GithubClientProvider, installationId int64, repoFullName string, repoOwner string, repoName string) (*github2.GithubService, *string, error)

func GetWorkflowIdAndUrlFromDiggerJobId

func GetWorkflowIdAndUrlFromDiggerJobId(client *github.Client, repoOwner string, repoName string, diggerJobID string) (int64, string, error)

func MatchesCrontab

func MatchesCrontab(cronString string, timestamp time.Time) (bool, error)

func SetPRStatusForJobs

func SetPRStatusForJobs(prService ci.PullRequestService, prNumber int, jobs []scheduler.Job) error

Types

type DiggerGithubClientMockProvider

type DiggerGithubClientMockProvider struct {
	MockedHTTPClient *net.Client
}

func (DiggerGithubClientMockProvider) FetchCredentials

func (gh DiggerGithubClientMockProvider) FetchCredentials(githubAppId string) (string, string, string, string, error)

func (DiggerGithubClientMockProvider) Get

func (gh DiggerGithubClientMockProvider) Get(githubAppId int64, installationId int64) (*github.Client, *string, error)

func (DiggerGithubClientMockProvider) NewClient

func (gh DiggerGithubClientMockProvider) NewClient(netClient *net.Client) (*github.Client, error)

type DiggerGithubRealClientProvider

type DiggerGithubRealClientProvider struct {
}

just a wrapper around github client to be able to use mocks

func (DiggerGithubRealClientProvider) FetchCredentials

func (gh DiggerGithubRealClientProvider) FetchCredentials(githubAppId string) (string, string, string, string, error)

func (DiggerGithubRealClientProvider) Get

func (gh DiggerGithubRealClientProvider) Get(githubAppId int64, installationId int64) (*github.Client, *string, error)

func (DiggerGithubRealClientProvider) NewClient

func (gh DiggerGithubRealClientProvider) NewClient(netClient *net.Client) (*github.Client, error)

type GithubClientProvider

type GithubClientProvider interface {
	NewClient(netClient *net.Client) (*github.Client, error)
	Get(githubAppId int64, installationId int64) (*github.Client, *string, error)
	FetchCredentials(githubAppId string) (string, string, string, string, error)
}

Jump to

Keyboard shortcuts

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