Versions in this module Expand all Collapse all v1 v1.0.0 Aug 25, 2026 Changes in this version + const DefaultMaxBytes + const DeployKeyComment + const ProviderGeneric + const ProviderGitHub + const ProviderGitLab + const ProviderGitea + const WorkspacePerm + var ErrAuthenticationRequired = errors.New("git: authentication required") + var ErrAuthorizationFailed = errors.New("git: authorization failed") + var ErrBaseDirEscapes = errors.New("git: base directory escapes the checkout") + var ErrBaseDirNotFound = errors.New("git: base directory does not exist in the checkout") + var ErrBranchNotFound = errors.New("git: branch not found on remote") + var ErrDestIsSymlink = errors.New("git: destination is a symlink") + var ErrDestNotEmpty = errors.New("git: destination exists and is not empty") + var ErrDockerfileEscapes = errors.New("git: Dockerfile escapes the build context") + var ErrInvalidBaseDir = errors.New("git: invalid base directory") + var ErrInvalidBranch = errors.New("git: invalid branch name") + var ErrInvalidDeploymentID = errors.New("git: invalid deployment id") + var ErrInvalidDockerfile = errors.New("git: invalid Dockerfile path") + var ErrInvalidKnownHosts = errors.New("git: invalid known_hosts") + var ErrInvalidURL = errors.New("git: invalid repository URL") + var ErrNoKnownHosts = errors.New("git: ssh known_hosts not configured and unknown hosts are not allowed") + var ErrNoSSHKey = errors.New("git: ssh repository URL requires a deploy key") + var ErrRepositoryNotFound = errors.New("git: repository not found") + var ErrTooLarge = errors.New("git: checkout exceeds the size limit") + var ErrWorkspaceExists = errors.New("git: workspace directory already exists") + var ErrWorkspaceRootInvalid = errors.New("git: workspace root is not a directory") + func CleanupWorkspace(root string, keep int) (int, error) + func GenerateDeployKey() (privatePEM []byte, publicAuthorizedKey, fingerprint string, err error) + func KnownHostsLine(hostPort string, key ssh.PublicKey) string + func LoadKnownHosts(path string) (string, error) + func NewWorkspaceDir(root, deploymentID string) (string, error) + func ResolveBranchHead(ctx context.Context, src Source) (string, error) + func SafeURL(u string) string + func ValidateBaseDir(s string) error + func ValidateBranch(b string) error + func ValidateRepoURL(u string, allowLocal bool) error + func WebhookSecret() (string, error) + type Auth struct + AllowUnknownHosts bool + SSHKnownHosts string + SSHPrivateKeyPEM []byte + Token string + type Checkout struct + Author string + Bytes int64 + CommitMessage string + CommitSHA string + ContextDir string + Dir string + DockerfilePath string + HasDockerfile bool + func Clone(ctx context.Context, src Source, dest string, maxBytes int64) (Checkout, error) + type Source struct + AllowLocal bool + Auth Auth + BaseDir string + Branch string + Dockerfile string + Provider string + URL string