当前位置: 首页>>代码示例>>Golang>>正文


Golang models.InstallerArguments类代码示例

本文整理汇总了Golang中models.InstallerArguments的典型用法代码示例。如果您正苦于以下问题:Golang InstallerArguments类的具体用法?Golang InstallerArguments怎么用?Golang InstallerArguments使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了InstallerArguments类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: fillSyslog

func fillSyslog(args *models.InstallerArguments, manifest models.Manifest) {
	repJob := firstRepJob(manifest)
	properties := repJob.Properties
	// TODO: this is broken on ops manager:
	//   1. there are no global properties section
	//   2. none of the diego jobs (including rep) has syslog_daemon_config
	if properties.Syslog == nil && manifest.Properties != nil {
		properties = manifest.Properties
	}

	if properties.Syslog == nil {
		return
	}

	args.SyslogHostIP = properties.Syslog.Address
	args.SyslogPort = properties.Syslog.Port
}
开发者ID:stefanschneider,项目名称:greenhouse-install-script-generator,代码行数:17,代码来源:generate.go

示例2: fillSharedSecret

func fillSharedSecret(args *models.InstallerArguments, manifest models.Manifest) {
	repJob := firstRepJob(manifest)
	properties := repJob.Properties
	if properties.MetronEndpoint == nil {
		properties = manifest.Properties
	}
	args.SharedSecret = properties.MetronEndpoint.SharedSecret
}
开发者ID:stefanschneider,项目名称:greenhouse-install-script-generator,代码行数:8,代码来源:generate.go

示例3: fillEtcdCluster

func fillEtcdCluster(args *models.InstallerArguments, manifest models.Manifest) {
	repJob := firstRepJob(manifest)
	properties := repJob.Properties
	if properties.Loggregator == nil {
		properties = manifest.Properties
	}

	args.EtcdCluster = properties.Loggregator.Etcd.Machines[0]
}
开发者ID:stefanschneider,项目名称:greenhouse-install-script-generator,代码行数:9,代码来源:generate.go

示例4: fillExternalIp

func fillExternalIp(args *models.InstallerArguments, manifest models.Manifest, externalIp string) {
	if externalIp == "" {
		consulIp := strings.Split(args.ConsulIPs, ",")[0]
		conn, err := net.Dial("udp", consulIp+":65530")
		FailOnError(err)
		externalIp = strings.Split(conn.LocalAddr().String(), ":")[0]
	}
	args.ExternalIp = externalIp
}
开发者ID:stefanschneider,项目名称:greenhouse-install-script-generator,代码行数:9,代码来源:generate.go

示例5: generateInstallScript

func generateInstallScript(outputDir string, args *models.InstallerArguments) {
	content := strings.Replace(installBatTemplate, "\n", "\r\n", -1)
	temp := template.Must(template.New("").Parse(content))
	args.Zone = "windows"
	filename := "install.bat"
	file, err := os.OpenFile(path.Join(outputDir, filename), os.O_TRUNC|os.O_CREATE|os.O_RDWR, 0644)
	Fatal(err)
	defer file.Close()

	err = temp.Execute(file, args)
	Fatal(err)
}
开发者ID:cloudfoundry-incubator,项目名称:greenhouse-install-script-generator,代码行数:12,代码来源:generate.go

示例6: fillConsul

func fillConsul(args *models.InstallerArguments, manifest models.Manifest, outputDir string) {
	repJob := firstRepJob(manifest)
	properties := repJob.Properties
	if properties.Consul == nil {
		properties = manifest.Properties
	}

	// missing requireSSL implies true
	requireSSL := properties.Consul.RequireSSL
	if requireSSL == nil || *requireSSL {
		args.ConsulRequireSSL = true
		extractConsulKeyAndCert(properties, outputDir)
	}

	consuls := properties.Consul.Agent.Servers.Lan

	if len(consuls) == 0 {
		fmt.Fprintf(os.Stderr, "Could not find any Consul VMs in your BOSH deployment")
		os.Exit(1)
	}

	args.ConsulIPs = strings.Join(consuls, ",")
}
开发者ID:stefanschneider,项目名称:greenhouse-install-script-generator,代码行数:23,代码来源:generate.go

示例7: fillBBS

func fillBBS(args *models.InstallerArguments, manifest models.Manifest, outputDir string) {
	repJob := firstRepJob(manifest)
	properties := repJob.Properties
	if properties.Diego.Rep.BBS == nil {
		properties = manifest.Properties
	}

	requireSSL := properties.Diego.Rep.BBS.RequireSSL
	// missing requireSSL implies true
	if requireSSL == nil || *requireSSL {
		args.BbsRequireSsl = true
		extractBbsKeyAndCert(properties, outputDir)
	}
}
开发者ID:stefanschneider,项目名称:greenhouse-install-script-generator,代码行数:14,代码来源:generate.go

示例8: fillMetronAgent

func fillMetronAgent(args *models.InstallerArguments, manifest models.Manifest, outputDir string) {
	repJob := firstRepJob(manifest)
	properties := repJob.Properties

	if properties.MetronAgent == nil || properties.MetronAgent.PreferredProtocol == nil {
		properties = manifest.Properties
	}

	if properties != nil && properties.MetronAgent != nil && properties.MetronAgent.PreferredProtocol != nil {
		if *properties.MetronAgent.PreferredProtocol == "tls" {
			args.MetronPreferTLS = true
			extractMetronKeyAndCert(properties, outputDir)
		}
	}
}
开发者ID:wdxxs2z,项目名称:greenhouse-install-script-generator,代码行数:15,代码来源:generate.go


注:本文中的models.InstallerArguments类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。