本文整理匯總了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
}
示例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
}
示例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]
}
示例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
}
示例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)
}
示例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, ",")
}
示例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)
}
}
示例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)
}
}
}