scm_provider

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	RepositoryMatch *regexp.Regexp
	PathsExist      []string
	LabelMatch      *regexp.Regexp
	BranchMatch     *regexp.Regexp
}

A compiled version of SCMProviderGeneratorFilter for performance.

type GithubProvider

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

func NewGithubProvider

func NewGithubProvider(ctx context.Context, organization string, token string, url string, allBranches bool) (*GithubProvider, error)

func (*GithubProvider) ListRepos

func (g *GithubProvider) ListRepos(ctx context.Context, cloneProtocol string) ([]*Repository, error)

func (*GithubProvider) RepoHasPath

func (g *GithubProvider) RepoHasPath(ctx context.Context, repo *Repository, path string) (bool, error)

type GitlabProvider

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

func NewGitlabProvider

func NewGitlabProvider(ctx context.Context, organization string, token string, url string, allBranches, includeSubgroups bool) (*GitlabProvider, error)

func (*GitlabProvider) ListRepos

func (g *GitlabProvider) ListRepos(ctx context.Context, cloneProtocol string) ([]*Repository, error)

func (*GitlabProvider) RepoHasPath

func (g *GitlabProvider) RepoHasPath(_ context.Context, repo *Repository, path string) (bool, error)

type MockProvider

type MockProvider struct {
	Repos []*Repository
}

func (*MockProvider) ListRepos

func (m *MockProvider) ListRepos(_ context.Context, _ string) ([]*Repository, error)

func (*MockProvider) RepoHasPath

func (*MockProvider) RepoHasPath(_ context.Context, repo *Repository, path string) (bool, error)

type Repository

type Repository struct {
	Organization string
	Repository   string
	URL          string
	Branch       string
	SHA          string
	Labels       []string
}

An abstract repository from an API provider.

func ListRepos

func ListRepos(ctx context.Context, provider SCMProviderService, filters []argoprojiov1alpha1.SCMProviderGeneratorFilter, cloneProtocol string) ([]*Repository, error)

type SCMProviderService

type SCMProviderService interface {
	ListRepos(context.Context, string) ([]*Repository, error)
	RepoHasPath(context.Context, *Repository, string) (bool, error)
}

Jump to

Keyboard shortcuts

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