本文整理汇总了Golang中github.com/bborbe/debian_utils/config_parser.ConfigParser类的典型用法代码示例。如果您正苦于以下问题:Golang ConfigParser类的具体用法?Golang ConfigParser怎么用?Golang ConfigParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ConfigParser类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: do
func do(
debianPackageCreatorArchive debian_package_creator_archive.DebianPackageCreator,
config_parser debian_config_parser.ConfigParser,
tarGzPath string,
configpath string,
version string,
targetDir string,
) error {
if len(tarGzPath) == 0 {
return fmt.Errorf("parameter %s missing", PARAMETER_CONFLUENCE_TAR_GZ_PATH)
}
var err error
config := createDefaultConfig()
if len(configpath) > 0 {
if config, err = config_parser.ParseFileToConfig(config, configpath); err != nil {
return err
}
}
config_builder := debian_config_builder.NewWithConfig(config)
if len(version) > 0 {
if err := config_builder.Version(version); err != nil {
return err
}
}
config = config_builder.Build()
if len(config.Version) == 0 {
return fmt.Errorf("paramter %s missing", PARAMETER_CONFLUENCE_VERSION)
}
sourceDir := fmt.Sprintf("atlassian-bamboo-%s", config.Version)
return debianPackageCreatorArchive.CreatePackage(tarGzPath, config, sourceDir, targetDir)
}
开发者ID:bborbe,项目名称:atlassian_utils,代码行数:31,代码来源:bamboo_create_deb.go
示例2: do
func do(writer io.Writer, debianPackageCreator debian_package_creator_archive.DebianPackageCreator, config_parser debian_config_parser.ConfigParser, tarGzPath string, configpath string, version string) error {
if len(tarGzPath) == 0 {
return fmt.Errorf("parameter %s missing", PARAMETER_SONAR_TAR_GZ)
}
var err error
config := createDefaultConfig()
if len(configpath) > 0 {
if config, err = config_parser.ParseFileToConfig(config, configpath); err != nil {
return err
}
}
config_builder := debian_config_builder.NewWithConfig(config)
if len(version) > 0 {
if err := config_builder.Version(version); err != nil {
return err
}
}
config = config_builder.Build()
if len(config.Version) == 0 {
return fmt.Errorf("paramter %s missing", PARAMETER_SONAR_VERSION)
}
sourceDir := fmt.Sprintf("nexus-%s-03", config.Version)
targetDir := "/opt/nexus"
return debianPackageCreator.CreatePackage(tarGzPath, config, sourceDir, targetDir)
}
开发者ID:bborbe,项目名称:nexus_utils,代码行数:25,代码来源:nexus_create_deb.go
示例3: do
func do(writer io.Writer, createPackage CreatePackage, config_parser debian_config_parser.ConfigParser, configpath string) error {
var err error
config := createDefaultConfig()
if len(configpath) > 0 {
if config, err = config_parser.ParseFileToConfig(config, configpath); err != nil {
return err
}
}
config_builder := debian_config_builder.NewWithConfig(config)
config = config_builder.Build()
sourceDir := "go"
targetDir := "/opt/go"
return createPackage(config, sourceDir, targetDir)
}
开发者ID:bborbe,项目名称:golang_utils,代码行数:14,代码来源:golang_create_latest_deb.go
示例4: do
func do(
createPackage CreatePackage,
config_parser debian_config_parser.ConfigParser,
configpath string, latestVersion LatestVersion,
targetDir string,
) error {
var err error
config := createDefaultConfig()
if len(configpath) > 0 {
if config, err = config_parser.ParseFileToConfig(config, configpath); err != nil {
return err
}
}
config_builder := debian_config_builder.NewWithConfig(config)
config = config_builder.Build()
config.Version, err = latestVersion()
if err != nil {
return err
}
sourceDir := fmt.Sprintf("atlassian-bamboo-%s", config.Version)
return createPackage(config, sourceDir, targetDir)
}
开发者ID:bborbe,项目名称:atlassian_utils,代码行数:22,代码来源:bamboo_create_latest_deb.go
示例5: do
func do(
config_parser debian_config_parser.ConfigParser,
configBuilderWithConfig ConfigBuilderWithConfig,
package_creator debian_package_creator.PackageCreator,
configpath string,
name string,
version string,
source string,
target string,
) error {
glog.Infof("config: %v name: %v version: %v source: %v target: %v", configpath, name, version, source, target)
var err error
config := debian_config.DefaultConfig()
if len(configpath) > 0 {
if config, err = config_parser.ParseFileToConfig(config, configpath); err != nil {
return err
}
}
config_builder := configBuilderWithConfig(config)
if len(source) > 0 && len(target) > 0 {
if err := config_builder.AddFile(source, target); err != nil {
return err
}
}
if len(name) > 0 {
if err := config_builder.Name(name); err != nil {
return err
}
}
if len(version) > 0 {
if err := config_builder.Version(version); err != nil {
return err
}
}
return package_creator.CreatePackage(config_builder.Build())
}
开发者ID:bborbe,项目名称:debian_utils,代码行数:36,代码来源:create_debian_package.go
注:本文中的github.com/bborbe/debian_utils/config_parser.ConfigParser类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论