gitrepo

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReplaceGitClientConstructors

func ReplaceGitClientConstructors(c GitRepoClient)

ReplaceGitClientConstructors replaces gitClientConstructors with the given one, TEST USE ONLY.

Types

type GitHubClientImpl

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

GitHubClientImpl implements GitRepoClient which works with GitHub.

func (GitHubClientImpl) CreatePullRequest

func (g GitHubClientImpl) CreatePullRequest(ctx context.Context, payload GitPullRequestPayload) (prNum int, err error)

func (GitHubClientImpl) HealthCheck

func (g GitHubClientImpl) HealthCheck() error

func (GitHubClientImpl) Kind

func (g GitHubClientImpl) Kind() string

type GitPullRequestPayload

type GitPullRequestPayload struct {
	HeadRef string
	BaseRef string
	Title   string
	Body    string
}

type GitRepoClient

type GitRepoClient interface {
	// Kind returns the kind of git-repo client.
	Kind() string

	// HealthCheck sends a simple query with auth-token to confirm that the request reaches and is accepted by remote git-repository.
	HealthCheck() error

	// CreatePullRequest creates PullRequest with given parameters.
	CreatePullRequest(ctx context.Context, payload GitPullRequestPayload) (prNum int, err error)
}

func NewGitHubClient

func NewGitHubClient(repoURL string, token string) GitRepoClient

NewGitHubClient creates new GitRepoClient which works with GitHub.

func NewGitRepoClient

func NewGitRepoClient(repoURL string, token string) (GitRepoClient, error)

NewGitRepoClient creates new GitRepoClient for the given git repository kind.

type GitRepoRef

type GitRepoRef struct {
	Owner string
	Name  string
}

func NewRepoRef

func NewRepoRef(repoURL string) (GitRepoRef, error)

NewRepoRef returns GitRepoRef from the remote hostname.

type NewGitClientFunc

type NewGitClientFunc func(repoURL string, token string) GitRepoClient

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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