git

package
v0.14.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateGitURLExists

func ValidateGitURLExists(ctx context.Context, urlPath string) error

ValidateGitURLExists validate if a source URL exists or not Note: We have an upcoming PR for the Build Status, where we intend to define a single Status.Reason in the form of 'remoteRepositoryUnreachable', where the Status.Message will contain the longer text, like 'invalid source url

Types

type ErrorClass added in v0.8.0

type ErrorClass int

ErrorClass classifies git stdout error messages in broader categories

const (
	// Unknown is the class of choice if no other class fits.
	Unknown ErrorClass = iota
	// AuthInvalidUserOrPass expresses that basic authentication is not possible.
	AuthInvalidUserOrPass
	// AuthExpectedSSH expresses that the ssh protocol is used for git operations but basic auth was provided.
	AuthExpectedSSH
	// AuthUnexpectedSSH expresses that the https protocol is used for git operations but a ssh key was provided.
	AuthUnexpectedSSH
	// AuthBasicIncomplete expresses that either username or password is missing in basic auth credentials
	AuthBasicIncomplete
	// AuthUnexpectedHTTP expresses that basic auth username and password are used in combination with a HTTP endpoint
	AuthUnexpectedHTTP
	// AuthInvalidKey expresses that ssh authentication is not possible
	AuthInvalidKey
	// RevisionNotFound expresses that a remote branch does not exist.
	RevisionNotFound
	// RepositoryNotFound expresses that the remote target for the git operation does not exist. It triggers when an
	// error message is enough to determine that the remote target does not exist and is mostly derived from the
	// Git server's messages e.g. GitLab or GitHub.
	RepositoryNotFound
	// AuthPrompted is caused when a repo is not found, is private and authentication is insufficient
	AuthPrompted
)

func (ErrorClass) String added in v0.8.0

func (class ErrorClass) String() string

func (ErrorClass) ToMessage added in v0.8.0

func (class ErrorClass) ToMessage() string

ToMessage is a function that transforms an error class to an error message

type ErrorResult added in v0.8.0

type ErrorResult struct {
	Message string
	Reason  ErrorClass
}

ErrorResult is a representation of a runtime error of a git operation that presents a reason and a message

func NewErrorResultFromMessage added in v0.8.0

func NewErrorResultFromMessage(message string) *ErrorResult

NewErrorResultFromMessage parses a message, derives an error result and returns an instance of ErrorResult.

type Prefix added in v0.8.0

type Prefix int

Prefix is part of an error message output and can be used to determine which participant in the git protocol send parts of the error message

Jump to

Keyboard shortcuts

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