git

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: 15 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func ParseUsernameAndPassword

func ParseUsernameAndPassword(secret string) (string, string)

func SortLanguagesWithFloats32

func SortLanguagesWithFloats32(languages map[string]float32) []string

SortLanguagesWithFloats32 sorts languages from the given map to a slice where the first one is with the highest number

func SortLanguagesWithInts

func SortLanguagesWithInts(languages map[string]int) []string

SortLanguagesWithInts sorts languages from the given map to a slice where the first one is with the highest number

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) GitAuthMethod

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

func (OauthToken) SecretContent

func (k OauthToken) SecretContent() string

func (OauthToken) SecretType

func (k OauthToken) SecretType() string

type Secret

type Secret interface {
	// GitAuthMethod returns an instance of git AuthMethod for the secret
	GitAuthMethod() (transport.AuthMethod, error)
	// Client returns an instance of http.Client for the secret
	Client() *http.Client
	// SecretType returns a type of the secret
	SecretType() string
	// SecretContent returns an actual content of the secret
	SecretContent() string
}

func NewGitSecret

func NewGitSecret(client client.Client, namespace string, gitSource *v1alpha1.GitSource) (Secret, error)

NewGitSecret retrieves a secret using the given client

type SecretProvider

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

func NewGitSecretProvider

func NewGitSecretProvider(client client.Client, namespace string, gitSource *v1alpha1.GitSource) (*SecretProvider, error)

NewGitSecretProvider retrieves secret using the given client and stores it to a new instance of GitSecretProvider that is then returned

func NewSecretProvider

func NewSecretProvider(secret Secret) *SecretProvider

func (*SecretProvider) GetSecret

func (p *SecretProvider) GetSecret(defaultSecret Secret) Secret

func (*SecretProvider) SecretType

func (p *SecretProvider) SecretType() 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) GitAuthMethod

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

func (SshKey) SecretContent

func (k SshKey) SecretContent() string

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) GitAuthMethod

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

func (UsernamePassword) SecretContent

func (k UsernamePassword) SecretContent() string

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