repository

package
v0.0.0-...-901927a Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const Master = "master"

Variables

This section is empty.

Functions

func NewRequest

func NewRequest(method, url string, secret git.Secret) (*http.Request, error)

Types

type FileExistenceChecker

type FileExistenceChecker interface {
	// GetListOfFoundFiles returns list of filenames present in the root directory
	GetListOfFoundFiles() []string
	// DetectFiles detects if any of the build tool files are present in the root directory
	DetectFiles(buildTool build.Tool) []string
}

func NewCheckerUsingHeaderRequests

func NewCheckerUsingHeaderRequests(log *log.GitSourceLogger, baseURL string, secret git.Secret) FileExistenceChecker

func NewCheckerWithFetchedFiles

func NewCheckerWithFetchedFiles(filenames []string) FileExistenceChecker

type GitService

type GitService interface {
	// FileExistenceChecker returns an instance of checker for existence of files in the root directory
	FileExistenceChecker() (FileExistenceChecker, error)
	// GetLanguageList returns list of detected languages in the sorted order where the first one is the most used
	GetLanguageList() ([]string, error)
	// CheckCredentials tries to get user  information associated with the attached secret from the git server
	CheckCredentials() error
	// Tries to connect to the git repository with the attached secret
	CheckRepoAccessibility() error
	// Checks if the branch exists in the git repository
	CheckBranch() error
}

func NewGitService

func NewGitService(log *log.GitSourceLogger, gitSource *v1alpha1.GitSource, secret *git.SecretProvider, serviceCreators []ServiceCreator) (GitService, error)

NewGitService returns an instance of GitService for the given v1alpha1.GitSource. If no service is matched then returns nil

type ServiceCreator

type ServiceCreator func(log *log.GitSourceLogger, gitSource *v1alpha1.GitSource, secret *git.SecretProvider) (GitService, error)

ServiceCreator creates an instance of GitService for the given v1alpha1.GitSource

type StructuredIdentifier

type StructuredIdentifier struct {
	Owner  string
	Name   string
	Branch string
}

StructuredIdentifier is an identifier of git repository that consist of a owner, name and branch

func NewStructuredIdentifier

func NewStructuredIdentifier(gitSource *v1alpha1.GitSource, endpoint *gittransport.Endpoint) (StructuredIdentifier, error)

NewStructuredIdentifier returns an instance of the StructuredIdentifier for the given v1alpha1.GitSource

func (StructuredIdentifier) OwnerWithName

func (i StructuredIdentifier) OwnerWithName() string

OwnerWithName joins owner and name by a slash

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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