本文整理匯總了Golang中github.com/github/git-lfs/config.Configuration.BasicTransfersOnly方法的典型用法代碼示例。如果您正苦於以下問題:Golang Configuration.BasicTransfersOnly方法的具體用法?Golang Configuration.BasicTransfersOnly怎麽用?Golang Configuration.BasicTransfersOnly使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/github/git-lfs/config.Configuration
的用法示例。
在下文中一共展示了Configuration.BasicTransfersOnly方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Environ
func Environ(cfg *config.Configuration, manifest *transfer.Manifest) []string {
osEnviron := os.Environ()
env := make([]string, 0, len(osEnviron)+7)
dltransfers := manifest.GetDownloadAdapterNames()
sort.Strings(dltransfers)
ultransfers := manifest.GetUploadAdapterNames()
sort.Strings(ultransfers)
fetchPruneConfig := cfg.FetchPruneConfig()
env = append(env,
fmt.Sprintf("LocalWorkingDir=%s", config.LocalWorkingDir),
fmt.Sprintf("LocalGitDir=%s", config.LocalGitDir),
fmt.Sprintf("LocalGitStorageDir=%s", config.LocalGitStorageDir),
fmt.Sprintf("LocalMediaDir=%s", LocalMediaDir()),
fmt.Sprintf("LocalReferenceDir=%s", config.LocalReferenceDir),
fmt.Sprintf("TempDir=%s", TempDir()),
fmt.Sprintf("ConcurrentTransfers=%d", cfg.ConcurrentTransfers()),
fmt.Sprintf("TusTransfers=%v", cfg.TusTransfersAllowed()),
fmt.Sprintf("BasicTransfersOnly=%v", cfg.BasicTransfersOnly()),
fmt.Sprintf("BatchTransfer=%v", cfg.BatchTransfer()),
fmt.Sprintf("SkipDownloadErrors=%v", cfg.SkipDownloadErrors()),
fmt.Sprintf("FetchRecentAlways=%v", fetchPruneConfig.FetchRecentAlways),
fmt.Sprintf("FetchRecentRefsDays=%d", fetchPruneConfig.FetchRecentRefsDays),
fmt.Sprintf("FetchRecentCommitsDays=%d", fetchPruneConfig.FetchRecentCommitsDays),
fmt.Sprintf("FetchRecentRefsIncludeRemotes=%v", fetchPruneConfig.FetchRecentRefsIncludeRemotes),
fmt.Sprintf("PruneOffsetDays=%d", fetchPruneConfig.PruneOffsetDays),
fmt.Sprintf("PruneVerifyRemoteAlways=%v", fetchPruneConfig.PruneVerifyRemoteAlways),
fmt.Sprintf("PruneRemoteName=%s", fetchPruneConfig.PruneRemoteName),
fmt.Sprintf("AccessDownload=%s", cfg.Access("download")),
fmt.Sprintf("AccessUpload=%s", cfg.Access("upload")),
fmt.Sprintf("DownloadTransfers=%s", strings.Join(dltransfers, ",")),
fmt.Sprintf("UploadTransfers=%s", strings.Join(ultransfers, ",")),
)
if len(cfg.FetchExcludePaths()) > 0 {
env = append(env, fmt.Sprintf("FetchExclude=%s", strings.Join(cfg.FetchExcludePaths(), ", ")))
}
if len(cfg.FetchIncludePaths()) > 0 {
env = append(env, fmt.Sprintf("FetchInclude=%s", strings.Join(cfg.FetchIncludePaths(), ", ")))
}
for _, ext := range cfg.Extensions() {
env = append(env, fmt.Sprintf("Extension[%d]=%s", ext.Priority, ext.Name))
}
for _, e := range osEnviron {
if !strings.Contains(e, "GIT_") {
continue
}
env = append(env, e)
}
return env
}
示例2: ConfigureManifest
func ConfigureManifest(m *Manifest, cfg *config.Configuration) *Manifest {
m.basicTransfersOnly = cfg.BasicTransfersOnly()
configureBasicDownloadAdapter(m)
configureBasicUploadAdapter(m)
if cfg.TusTransfersAllowed() {
configureTusAdapter(m)
}
configureCustomAdapters(cfg, m)
return m
}