scm_clients

package
v0.4.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitBucketClient

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

func (BitBucketClient) ChangedFilesInDiff

func (s BitBucketClient) ChangedFilesInDiff(ctx context.Context, base string, head string) ([]string, error)

func (BitBucketClient) ChangedFilesInPullRequest

func (s BitBucketClient) ChangedFilesInPullRequest(ctx context.Context, pullRequestID int) ([]string, error)

func (BitBucketClient) GetFileContents

func (s BitBucketClient) GetFileContents(ctx context.Context, path string, commitRef string) (content string, err error)

func (BitBucketClient) GetFileListing

func (s BitBucketClient) GetFileListing(ctx context.Context, path string, commitRef string) (
	fileListing []FileListingEntry, err error)

type BitBucketCredentials

type BitBucketCredentials struct {
	AccessToken string `json:"access_token"`
}

type FileListingEntry

type FileListingEntry struct {
	Type string
	Name string
	Path string
}

type GithubClient

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

func (GithubClient) ChangedFilesInDiff

func (s GithubClient) ChangedFilesInDiff(ctx context.Context, base string, head string) ([]string, error)

func (GithubClient) ChangedFilesInPullRequest

func (s GithubClient) ChangedFilesInPullRequest(ctx context.Context, pullRequestID int) ([]string, error)

func (GithubClient) GetFileContents

func (s GithubClient) GetFileContents(ctx context.Context, path string, commitRef string) (content string, err error)

func (GithubClient) GetFileListing

func (s GithubClient) GetFileListing(ctx context.Context, path string, commitRef string) (
	fileListing []FileListingEntry, err error)

type GitlabClient added in v0.3.5

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

func (GitlabClient) ChangedFilesInDiff added in v0.3.5

func (s GitlabClient) ChangedFilesInDiff(ctx context.Context, base string, head string) ([]string, error)

func (GitlabClient) ChangedFilesInPullRequest added in v0.3.5

func (s GitlabClient) ChangedFilesInPullRequest(ctx context.Context, pullRequestID int) ([]string, error)

func (GitlabClient) GetFileContents added in v0.3.5

func (s GitlabClient) GetFileContents(ctx context.Context, path string, commitRef string) (content string, err error)

func (GitlabClient) GetFileListing added in v0.3.5

func (s GitlabClient) GetFileListing(ctx context.Context, path string, commitRef string) (
	fileListing []FileListingEntry, err error)

type ScmClient

type ScmClient interface {
	ChangedFilesInPullRequest(ctx context.Context, pullRequestID int) ([]string, error)
	ChangedFilesInDiff(ctx context.Context, base string, head string) ([]string, error)
	GetFileContents(ctx context.Context, path string, commitRef string) (
		fileContent string, err error)
	GetFileListing(ctx context.Context, path string, commitRef string) (
		fileListing []FileListingEntry, err error)
}

func NewBitBucketClient

func NewBitBucketClient(someUUID uuid.UUID, authServer string, server string,
	clientID string, clientSecret string, repo drone.Repo) (ScmClient, error)

func NewGitHubClient

func NewGitHubClient(ctx context.Context, uuid uuid.UUID, server string, token string, repo drone.Repo) (ScmClient, error)

NewGitHubClient creates a GithubClient which can be used to send requests to the Github API

func NewGitLabClient added in v0.3.5

func NewGitLabClient(ctx context.Context, uuid uuid.UUID, server string, token string, repo drone.Repo) (ScmClient, error)

Jump to

Keyboard shortcuts

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