git

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

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

Go to latest
Published: Mar 15, 2019 License: Apache-2.0 Imports: 13 Imported by: 4 modules, 5 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	SshKeyType           = "SshKey"
	OauthTokenType       = "OauthToken"
	UsernamePasswordType = "UsernamePassword"
)
View Source
const (
	Master = "master"
)

Variables

This section is empty.

Functions

func GetSortedLanguages

func GetSortedLanguages(langsWithSizes map[string]int) []string

func ParseUsernameAndPassword

func ParseUsernameAndPassword(secret string) (string, string)

Types

type OauthToken

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

func NewOauthToken

func NewOauthToken(token []byte) *OauthToken

func (*OauthToken) Client

func (t *OauthToken) Client() *http.Client

func (OauthToken) Content

func (k OauthToken) Content() string

func (*OauthToken) GitAuthMethod

func (t *OauthToken) GitAuthMethod() (transport.AuthMethod, error)

func (OauthToken) SecretType

func (k OauthToken) SecretType() string

type Repository

type Repository struct {
	Owner      string
	Repository string
	Branch     string
	Token      string
}

func NewRepository

func NewRepository(gitSource *Source, url *url.URL) (Repository, error)

type Secret

type Secret interface {
	GitAuthMethod() (transport.AuthMethod, error)
	Client() *http.Client
	SecretType() string
	Content() string
}

type Service

type Service interface {
	Exists(filePath string) bool
	GetLanguageList() ([]string, error)
}

func NewService

func NewService(gitSource *Source, serviceCreators []ServiceCreator) (Service, error)

type ServiceCreator

type ServiceCreator func(gitSource *Source) (Service, error)

type Source

type Source struct {
	// URL of the git repo
	URL string

	// Ref is a git reference. Optional. "Master" is used by default.
	Ref string

	// ContextDir is a path to subfolder in the repo. Optional.
	ContextDir string

	// HttpProxy is optional.
	HttpProxy string

	// HttpsProxy is optional.
	HttpsProxy string

	// NoProxy can be used to specify domains for which no proxying should be performed. Optional.
	NoProxy string

	// Secret refers to the credentials to access the git repo. Optional.
	Secret Secret

	// Flavor of the git provider like github, gitlab, bitbucket, generic, etc. Optional.
	Flavor string
}

type SshKey

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

func NewSshKey

func NewSshKey(sshKey []byte, passphrase []byte) *SshKey

func (*SshKey) Client

func (k *SshKey) Client() *http.Client

func (SshKey) Content

func (k SshKey) Content() string

func (*SshKey) GitAuthMethod

func (k *SshKey) GitAuthMethod() (transport.AuthMethod, error)

func (SshKey) SecretType

func (k SshKey) SecretType() string

type UsernamePassword

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

func NewUsernamePassword

func NewUsernamePassword(username, password string) *UsernamePassword

func (*UsernamePassword) Client

func (t *UsernamePassword) Client() *http.Client

func (UsernamePassword) Content

func (k UsernamePassword) Content() string

func (*UsernamePassword) GitAuthMethod

func (t *UsernamePassword) GitAuthMethod() (transport.AuthMethod, error)

func (UsernamePassword) SecretType

func (k UsernamePassword) SecretType() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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