Documentation
¶
Overview ¶
Package gitinfo provides a client to interact with the git information service to retrieve metadata about git repositories.
Index ¶
Constants ¶
const ( PrivateKeySecretKey = "privatekey" UsernameSecretKey = "username" PasswordSecretKey = "password" )
Variables ¶
This section is empty.
Functions ¶
func AuthSecretName ¶
func AuthSecretName(app *apps.Application) string
AuthSecretName returns the name of the secret which contains the git credentials for the given applications git source
func NewAuthSecret ¶
func NewAuthSecret(app *apps.Application) *corev1.Secret
NewAuthSecret returns a new secret for the given application. It can be used as a key for Get/Delete operations or as a base for populating credentials.
Types ¶
type Auth ¶
Auth contains the credentials for a git repository.
func (Auth) ApplyToSecret ¶
ApplyToSecret writes the Auth credentials into the given secret's Data field. Only writes fields which are non-nil.
func (Auth) HasBasicAuth ¶
func (Auth) HasPrivateKey ¶
func (*Auth) UpdateFromSecret ¶
UpdateFromSecret updates the Auth object with the data from the given secret.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for the git information service.
func New ¶
New returns a client which can be used to retrieve metadata information about a given git repository
func (*Client) RepositoryInformation ¶
func (g *Client) RepositoryInformation(ctx context.Context, git apps.GitTarget, auth Auth) (*apps.GitExploreResponse, error)
RepositoryInformation returns information about a given git repository and optionally checks if a given revision can be found in the repo. It retries on client connection issues.
func (*Client) SetLogRetryFunc ¶
SetLogRetryFunc sets the function which logs retries when doing requests to the git information service. Without one, retries are not logged.
func (*Client) SetRetryBackoffs ¶
SetRetryBackoffs sets the backoff properties for retries