本文整理汇总了Golang中github.com/bborbe/http/client_builder.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了New函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: main
func main() {
defer glog.Flush()
glog.CopyStandardLogTo("info")
flag.Parse()
runtime.GOMAXPROCS(runtime.NumCPU())
httpClientBuilder := http_client_builder.New()
httpClient := httpClientBuilder.Build()
latestInformations := atlassian_utils_latest_information.New(bitbucket.JSON_URL, httpClient.Get)
latestUrl := atlassian_utils_latest_tar_gz_url.New(latestInformations.VersionInformations)
latestVersion := atlassian_utils_latest_version.New(latestInformations.VersionInformations)
commandListProvider := func() command_list.CommandList {
return command_list.New()
}
config_parser := debian_config_parser.New()
copier := debian_copier.New()
zipExtractor := debian_zip_extractor.New()
tarGzExtractor := debian_tar_gz_extractor.New()
requestbuilderProvider := http_requestbuilder.NewHTTPRequestBuilderProvider()
debianPackageCreator := debian_package_creator.New(commandListProvider, copier, tarGzExtractor.ExtractTarGz, zipExtractor.ExtractZip, httpClient.Do, requestbuilderProvider.NewHTTPRequestBuilder)
creatorByReader := debian_package_creator_by_reader.New(commandListProvider, debianPackageCreator, tarGzExtractor.ExtractTarGz)
latestDebianPackageCreator := debian_latest_package_creator.New(httpClient.Get, latestUrl.LatestConfluenceTarGzUrl, latestVersion.LatestVersion, creatorByReader.CreatePackage)
err := do(
latestDebianPackageCreator.CreateLatestDebianPackage,
config_parser,
*configPtr,
latestVersion.LatestVersion,
*targetDirPtr,
)
if err != nil {
glog.Exit(err)
}
}
开发者ID:bborbe,项目名称:atlassian_utils,代码行数:35,代码来源:bitbucket_create_deb.go
示例2: main
func main() {
defer glog.Flush()
glog.CopyStandardLogTo("info")
flag.Parse()
runtime.GOMAXPROCS(runtime.NumCPU())
commandListProvider := func() command_list.CommandList {
return command_list.New()
}
config_parser := debian_config_parser.New()
copier := debian_copier.New()
zipExtractor := debian_zip_extractor.New()
tarGzExtractor := debian_tar_gz_extractor.New()
httpClientBuilder := http_client_builder.New().WithoutProxy()
httpClient := httpClientBuilder.Build()
requestbuilderProvider := http_requestbuilder.NewHTTPRequestBuilderProvider()
debianPackageCreator := debian_package_creator.New(commandListProvider, copier, tarGzExtractor.ExtractTarGz, zipExtractor.ExtractZip, httpClient.Do, requestbuilderProvider.NewHTTPRequestBuilder)
creatorByReader := debian_package_creator_by_reader.New(commandListProvider, debianPackageCreator, tarGzExtractor.ExtractTarGz)
debianPackageCreatorArchive := debian_package_creator_archive.New(creatorByReader.CreatePackage)
err := do(
debianPackageCreatorArchive,
config_parser,
*tarGzPathPtr,
*configPtr,
*versionPtr,
*targetDirPtr,
)
if err != nil {
glog.Exit(err)
}
}
开发者ID:bborbe,项目名称:atlassian_utils,代码行数:32,代码来源:bamboo_create_deb.go
示例3: main
func main() {
defer glog.Flush()
glog.CopyStandardLogTo("info")
flag.Parse()
runtime.GOMAXPROCS(runtime.NumCPU())
httpClient := http_client_builder.New().WithoutProxy().Build()
requestbuilder_executor := aptly_requestbuilder_executor.New(httpClient.Do)
requestbuilder := http_requestbuilder.NewHTTPRequestBuilderProvider()
repo_publisher := aptly_repo_publisher.New(requestbuilder_executor, requestbuilder)
repo_creater := aptly_repo_creater.New(requestbuilder_executor, requestbuilder, repo_publisher.PublishNewRepo)
if len(*repoURLPtr) == 0 {
*repoURLPtr = *apiURLPtr
}
err := do(
repo_creater,
*repoURLPtr,
*apiURLPtr,
*apiUserPtr,
*apiPasswordPtr,
*apiPasswordFilePtr,
*repoPtr,
*distributionPtr,
strings.Split(*architecturePtr, ","),
)
if err != nil {
glog.Exit(err)
}
}
开发者ID:bborbe,项目名称:aptly_utils,代码行数:32,代码来源:aptly_create_repo.go
示例4: main
func main() {
defer glog.Flush()
glog.CopyStandardLogTo("info")
flag.Parse()
runtime.GOMAXPROCS(runtime.NumCPU())
httpClient := http_client_builder.New().WithoutProxy().Build()
httpRequestBuilderProvider := http_requestbuilder.NewHTTPRequestBuilderProvider()
package_lister := aptly_package_lister.New(httpClient.Do, httpRequestBuilderProvider.NewHTTPRequestBuilder)
if len(*repoURLPtr) == 0 {
*repoURLPtr = *apiURLPtr
}
writer := os.Stdout
err := do(
writer,
package_lister,
*repoURLPtr,
*apiURLPtr,
*apiUserPtr,
*apiPasswordPtr,
*apiPasswordFilePtr,
*repoPtr,
)
if err != nil {
glog.Exit(err)
}
}
开发者ID:bborbe,项目名称:aptly_utils,代码行数:28,代码来源:aptly_package_lister.go
示例5: main
func main() {
defer glog.Flush()
glog.CopyStandardLogTo("info")
flag.Parse()
runtime.GOMAXPROCS(runtime.NumCPU())
httpClientBuilder := http_client_builder.New()
httpClient := httpClientBuilder.Build()
latestVersion := sonar_latest_version.New(httpClient.Get)
urlByVersion := url_by_version.New()
latestUrl := sonar_latest_zip_url.New(latestVersion.LatestSonarVersion, urlByVersion.SonarZipUrlForVersion)
commandListProvider := func() command_list.CommandList {
return command_list.New()
}
config_parser := debian_config_parser.New()
copier := debian_copier.New()
zipExtractor := debian_zip_extractor.New()
tarGzExtractor := debian_tar_gz_extractor.New()
requestbuilderProvider := http_requestbuilder.NewHTTPRequestBuilderProvider()
debianPackageCreator := debian_package_creator.New(commandListProvider, copier, tarGzExtractor.ExtractTarGz, zipExtractor.ExtractZip, httpClient.Do, requestbuilderProvider.NewHTTPRequestBuilder)
creatorByReader := debian_package_creator_by_reader.New(commandListProvider, debianPackageCreator, zipExtractor.ExtractZip)
latestDebianPackageCreator := debian_latest_package_creator.New(httpClient.Get, latestUrl.LatestSonarZipUrl, latestVersion.LatestSonarVersion, creatorByReader.CreatePackage)
writer := os.Stdout
err := do(writer, latestDebianPackageCreator.CreateLatestDebianPackage, config_parser.ParseFileToConfig, latestVersion.LatestSonarVersion, *configPtr)
if err != nil {
glog.Exit(err)
}
}
开发者ID:bborbe,项目名称:sonar_utils,代码行数:30,代码来源:sonar_create_latest_deb.go
示例6: main
func main() {
defer glog.Flush()
glog.CopyStandardLogTo("info")
flag.Parse()
runtime.GOMAXPROCS(runtime.NumCPU())
httpClient := http_client_builder.New().WithoutProxy().Build()
httpRequestBuilderProvider := http_requestbuilder.NewHTTPRequestBuilderProvider()
packageLister := aptly_package_lister.New(httpClient.Do, httpRequestBuilderProvider.NewHTTPRequestBuilder)
requestbuilder_executor := aptly_requestbuilder_executor.New(httpClient.Do)
repoPublisher := aptly_repo_publisher.New(requestbuilder_executor, httpRequestBuilderProvider)
packageDeleter := aptly_package_deleter.New(httpClient.Do, httpRequestBuilderProvider.NewHTTPRequestBuilder, repoPublisher.PublishRepo)
repoCleaner := aptly_repo_cleaner.New(packageDeleter.DeletePackagesByKey, packageLister.ListPackages)
if len(*repoURLPtr) == 0 {
*repoURLPtr = *apiURLPtr
}
err := do(
repoCleaner,
*repoURLPtr,
*apiURLPtr,
*apiUserPtr,
*apiPasswordPtr,
*apiPasswordFilePtr,
*repoPtr,
*distributionPtr,
)
if err != nil {
glog.Exit(err)
}
}
开发者ID:bborbe,项目名称:aptly_utils,代码行数:33,代码来源:aptly_clean_repo.go
示例7: main
func main() {
defer glog.Flush()
glog.CopyStandardLogTo("info")
flag.Parse()
runtime.GOMAXPROCS(runtime.NumCPU())
httpClientBuilder := http_client_builder.New().WithoutProxy()
httpClient := httpClientBuilder.Build()
requestbuilderProvider := http_requestbuilder.NewHTTPRequestBuilderProvider()
downloader := debian_url_downloader.New(httpClient.Do, requestbuilderProvider.NewHTTPRequestBuilder)
lineInspector := debian_line_inspector.New(downloader.DownloadURL)
hasChanged := debian_apt_source_has_changed.New(lineInspector.HasLineChanged)
bool, err := do(
hasChanged,
*pathPtr,
)
if err != nil {
glog.Exit(err)
}
if bool {
glog.Flush()
os.Exit(0)
} else {
glog.Flush()
os.Exit(1)
}
}
开发者ID:bborbe,项目名称:debian_utils,代码行数:28,代码来源:update_available_apt_source_list.go
示例8: main
func main() {
defer glog.Flush()
glog.CopyStandardLogTo("info")
flag.Parse()
runtime.GOMAXPROCS(runtime.NumCPU())
commandListProvider := func() debian_command_list.CommandList {
return debian_command_list.New()
}
configBuilderWithConfig := func(config *debian_config.Config) debian_config_builder.ConfigBuilder {
return debian_config_builder.NewWithConfig(config)
}
config_parser := debian_config_parser.New()
copier := debian_copier.New()
zipExtractor := debian_zip_extractor.New()
tarGzExtractor := debian_tar_gz_extractor.New()
httpClientBuilder := http_client_builder.New().WithoutProxy()
httpClient := httpClientBuilder.Build()
requestbuilderProvider := http_requestbuilder.NewHTTPRequestBuilderProvider()
debianPackageCreator := debian_package_creator.New(commandListProvider, copier, tarGzExtractor.ExtractTarGz, zipExtractor.ExtractZip, httpClient.Do, requestbuilderProvider.NewHTTPRequestBuilder)
err := do(config_parser, configBuilderWithConfig, debianPackageCreator, *configPtr, *namePtr, *versionPtr, *sourcePtr, *targetPtr)
if err != nil {
glog.Exit(err)
}
}
开发者ID:bborbe,项目名称:debian_utils,代码行数:26,代码来源:create_debian_package.go
示例9: main
func main() {
defer glog.Flush()
glog.CopyStandardLogTo("info")
flag.Parse()
runtime.GOMAXPROCS(runtime.NumCPU())
writer := os.Stdout
httpClientBuilder := http_client_builder.New()
httpClient := httpClientBuilder.Build()
latestVersion := latest_version.New(httpClient.Get)
err := do(writer, latestVersion.LatestGolangVersion)
if err != nil {
glog.Exit(err)
}
}
开发者ID:bborbe,项目名称:golang_utils,代码行数:15,代码来源:golang_latest_version.go
示例10: main
func main() {
defer glog.Flush()
glog.CopyStandardLogTo("info")
flag.Parse()
runtime.GOMAXPROCS(runtime.NumCPU())
writer := os.Stdout
httpClientBuilder := http_client_builder.New()
httpClient := httpClientBuilder.Build()
latestVersion := latest_version.New(httpClient.Get)
urlByVersion := url_by_version.New()
latestZipUrl := latest_zip_url.New(latestVersion.LatestSonarVersion, urlByVersion.SonarZipUrlForVersion)
err := do(writer, latestZipUrl.LatestSonarZipUrl)
if err != nil {
glog.Exit(err)
}
}
开发者ID:bborbe,项目名称:sonar_utils,代码行数:17,代码来源:sonar_latest_zip_url.go
示例11: main
func main() {
defer glog.Flush()
glog.CopyStandardLogTo("info")
flag.Parse()
runtime.GOMAXPROCS(runtime.NumCPU())
httpClientBuilder := http_client_builder.New()
httpClient := httpClientBuilder.Build()
bambooLatestInformations := atlassian_utils_latest_information.New(bamboo.JSON_URL, httpClient.Get)
bambooLatestVersion := atlassian_utils_latest_version.New(bambooLatestInformations.VersionInformations)
confluenceLatestInformations := atlassian_utils_latest_information.New(confluence.JSON_URL, httpClient.Get)
confluenceLatestVersion := atlassian_utils_latest_version.New(confluenceLatestInformations.VersionInformations)
jiraCorelatestInformations := atlassian_utils_latest_information.New(jira_core.JSON_URL, httpClient.Get)
jiraCoreLatestVersion := atlassian_utils_latest_version.New(jiraCorelatestInformations.VersionInformations)
jiraServiceDeskLatestInformations := atlassian_utils_latest_information.New(jira_servicedesk.JSON_URL, httpClient.Get)
jiraServiceDeskLatestVersion := atlassian_utils_latest_version.New(jiraServiceDeskLatestInformations.VersionInformations)
jiraSoftwareLatestInformations := atlassian_utils_latest_information.New(jira_software.JSON_URL, httpClient.Get)
jiraSoftwareLatestVersion := atlassian_utils_latest_version.New(jiraSoftwareLatestInformations.VersionInformations)
bitbucketLatestInformations := atlassian_utils_latest_information.New(bitbucket.JSON_URL, httpClient.Get)
bitbucketLatestVersion := atlassian_utils_latest_version.New(bitbucketLatestInformations.VersionInformations)
crowdLatestInformations := atlassian_utils_latest_information.New(crowd.JSON_URL, httpClient.Get)
crowdLatestVersion := atlassian_utils_latest_version.New(crowdLatestInformations.VersionInformations)
writer := os.Stdout
err := do(
writer,
bambooLatestVersion.LatestVersion,
confluenceLatestVersion.LatestVersion,
jiraCoreLatestVersion.LatestVersion,
jiraServiceDeskLatestVersion.LatestVersion,
jiraSoftwareLatestVersion.LatestVersion,
bitbucketLatestVersion.LatestVersion,
crowdLatestVersion.LatestVersion,
)
if err != nil {
glog.Exit(err)
}
}
开发者ID:bborbe,项目名称:atlassian_utils,代码行数:45,代码来源:atlassian_latest_versions.go
示例12: main
func main() {
defer glog.Flush()
glog.CopyStandardLogTo("info")
flag.Parse()
runtime.GOMAXPROCS(runtime.NumCPU())
httpClient := http_client_builder.New().WithoutProxy().Build()
httpRequestBuilderProvider := http_requestbuilder.NewHTTPRequestBuilderProvider()
requestbuilder_executor := aptly_requestbuilder_executor.New(httpClient.Do)
requestbuilder := http_requestbuilder.NewHTTPRequestBuilderProvider()
repo_publisher := aptly_repo_publisher.New(requestbuilder_executor, requestbuilder)
packageUploader := aptly_package_uploader.New(requestbuilder_executor, requestbuilder, repo_publisher.PublishRepo)
packageCopier := aptly_package_copier.New(packageUploader, requestbuilder, httpClient.Do)
packageLister := aptly_package_lister.New(httpClient.Do, httpRequestBuilderProvider.NewHTTPRequestBuilder)
packageDetailLister := aptly_model_lister.New(packageLister.ListPackages)
packageVersion := aptly_package_versions.New(packageDetailLister.ListPackageDetails)
packageLastestVersion := aptly_package_latest_version.New(packageVersion.PackageVersions)
packageDetailLatestLister := aptly_model_latest_lister.New(packageDetailLister.ListPackageDetails)
if len(*repoURLPtr) == 0 {
*repoURLPtr = *apiURLPtr
}
err := do(
packageCopier,
packageLastestVersion,
packageDetailLatestLister,
*repoURLPtr,
*apiURLPtr,
*apiUserPtr,
*apiPasswordPtr,
*apiPasswordFilePtr,
*sourcePtr,
*targetPtr,
*targetDistributionPtr,
*namePtr,
*versionPtr,
)
if err != nil {
glog.Exit(err)
}
}
开发者ID:bborbe,项目名称:aptly_utils,代码行数:43,代码来源:aptly_copy_package.go
示例13: main
func main() {
defer glog.Flush()
glog.CopyStandardLogTo("info")
flag.Parse()
runtime.GOMAXPROCS(runtime.NumCPU())
httpClientBuilder := http_client_builder.New()
httpClient := httpClientBuilder.Build()
latestInformations := atlassian_utils_latest_information.New(crowd.JSON_URL, httpClient.Get)
latestVersion := atlassian_utils_latest_version.New(latestInformations.VersionInformations)
writer := os.Stdout
err := do(
writer,
latestVersion.LatestVersion,
)
if err != nil {
glog.Exit(err)
}
}
开发者ID:bborbe,项目名称:atlassian_utils,代码行数:20,代码来源:crowd_latest_version.go
示例14: main
func main() {
defer glog.Flush()
glog.CopyStandardLogTo("info")
flag.Parse()
runtime.GOMAXPROCS(runtime.NumCPU())
httpClientBuilder := http_client_builder.New()
httpClient := httpClientBuilder.Build()
latestInformations := atlassian_utils_latest_information.New(bitbucket.JSON_URL, httpClient.Get)
latestUrl := atlassian_utils_latest_tar_gz_url.New(latestInformations.VersionInformations)
writer := os.Stdout
err := do(
writer,
latestUrl.LatestConfluenceTarGzUrl,
)
if err != nil {
glog.Exit(err)
}
}
开发者ID:bborbe,项目名称:atlassian_utils,代码行数:20,代码来源:bitbucket_latest_tar_gz_url.go
注:本文中的github.com/bborbe/http/client_builder.New函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论