Movatterモバイル変換


[0]ホーム

URL:


git

package
v1.1.0Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License:Apache-2.0Imports:22Imported by:0

Details

Repository

github.com/coder/envbuilder

Links

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcCloneRepo

func CloneRepo(ctxcontext.Context, logf func(string, ...any), optsCloneRepoOptions) (bool,error)

CloneRepo will clone the repository at the given URL into the given path.If a repository is already initialized at the given path, it will notbe cloned again.

The bool returned states whether the repository was cloned or not.

funcDecodeBase64PrivateKeyadded inv1.0.4

func DecodeBase64PrivateKey(keystring) (gossh.Signer,error)

DecodeBase64PrivateKey attempts to decode a base64 encoded privatekey and returns an ssh.Signer

funcLogHostKeyCallback

func LogHostKeyCallback(logger func(string, ...any))gossh.HostKeyCallback

LogHostKeyCallback is a HostKeyCallback that just logs host keysand does nothing else.

funcProgressWriter

func ProgressWriter(write func(linestring, args ...any))io.WriteCloser

funcReadPrivateKey

func ReadPrivateKey(pathstring) (gossh.Signer,error)

ReadPrivateKey attempts to read an SSH private key from pathand returns an ssh.Signer.

funcSetupRepoAuth

func SetupRepoAuth(logf func(string, ...any), options *options.Options)transport.AuthMethod

SetupRepoAuth determines the desired AuthMethod based on options.GitURL:

| Git URL format | GIT_USERNAME | GIT_PASSWORD | Auth Method || ------------------------|--------------|--------------|-------------|| https?://host.tld/repo | Not Set | Not Set | None || https?://host.tld/repo | Not Set | Set | HTTP Basic || https?://host.tld/repo | Set | Not Set | HTTP Basic || https?://host.tld/repo | Set | Set | HTTP Basic ||file://path/to/repo | - | - | None || path/to/repo | - | - | None || All other formats | - | - | SSH |

For SSH authentication, the default username is "git" but will honourGIT_USERNAME if set.

If SSH_PRIVATE_KEY_PATH is set, an SSH private key will be read fromthat path and the SSH auth method will be configured with that key.

If SSH_KNOWN_HOSTS is not set, the SSH auth method will be configuredto accept and log all host keys. Otherwise, host key checking will beperformed as usual.

funcShallowCloneRepo

func ShallowCloneRepo(ctxcontext.Context, logf func(string, ...any), optsCloneRepoOptions)error

ShallowCloneRepo will clone the repository at the given URL into the given pathwith a depth of 1. If the destination folder exists and is not empty, theclone will not be performed.

The bool returned states whether the repository was cloned or not.

Types

typeCloneRepoOptions

type CloneRepoOptions struct {PathstringStorage billy.FilesystemRepoURLstringRepoAuthtransport.AuthMethodProgresssideband.ProgressInsecureboolSingleBranchboolDepthintCABundle     []byteProxyOptionstransport.ProxyOptions}

funcCloneOptionsFromOptions

func CloneOptionsFromOptions(logf func(string, ...any), optionsoptions.Options) (CloneRepoOptions,error)

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp