當前位置: 首頁>>代碼示例>>Golang>>正文


Golang Settings.Float64方法代碼示例

本文整理匯總了Golang中github.com/wercker/wercker/util.Settings.Float64方法的典型用法代碼示例。如果您正苦於以下問題:Golang Settings.Float64方法的具體用法?Golang Settings.Float64怎麽用?Golang Settings.Float64使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/wercker/wercker/util.Settings的用法示例。


在下文中一共展示了Settings.Float64方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: NewPipelineOptions

// NewPipelineOptions big-ass constructor
func NewPipelineOptions(c util.Settings, e *util.Environment) (*PipelineOptions, error) {
	globalOpts, err := NewGlobalOptions(c, e)
	if err != nil {
		return nil, err
	}

	// dockerOpts, err := NewDockerOptions(c, e, globalOpts)
	// if err != nil {
	//   return nil, err
	// }

	awsOpts, err := NewAWSOptions(c, e, globalOpts)
	if err != nil {
		return nil, err
	}

	gitOpts, err := NewGitOptions(c, e, globalOpts)
	if err != nil {
		return nil, err
	}

	keenOpts, err := NewKeenOptions(c, e, globalOpts)
	if err != nil {
		return nil, err
	}

	reporterOpts, err := NewReporterOptions(c, e, globalOpts)
	if err != nil {
		return nil, err
	}

	buildID, _ := c.String("build-id")
	deployID, _ := c.String("deploy-id")
	pipelineID := ""
	if deployID != "" {
		pipelineID = deployID
	} else {
		pipelineID = buildID
	}
	deployTarget, _ := c.String("deploy-target")
	pipeline, _ := c.String("pipeline")

	applicationName, err := guessApplicationName(c, e)
	if err != nil {
		return nil, err
	}
	applicationID := guessApplicationID(c, e, applicationName)
	applicationOwnerName := guessApplicationOwnerName(c, e)
	applicationStartedByName, _ := c.String("application-started-by-name")
	if applicationStartedByName == "" {
		applicationStartedByName = applicationOwnerName
	}

	repository, _ := c.String("commit")
	shouldCommit := (repository != "")
	tag := guessTag(c, e)
	message := guessMessage(c, e)
	shouldStoreLocal, _ := c.Bool("store-local")
	shouldStoreS3, _ := c.Bool("store-s3")

	workingDir, _ := c.String("working-dir")
	workingDir, _ = filepath.Abs(workingDir)

	guestRoot, _ := c.String("guest-root")
	mntRoot, _ := c.String("mnt-root")
	reportRoot, _ := c.String("report-root")

	projectID := guessProjectID(c, e)
	projectPath := guessProjectPath(c, e)
	projectURL := guessProjectURL(c, e)

	if projectPath == workingDir {
		return nil, fmt.Errorf("Project path can't be the same as the working dir")
	}

	// These timeouts are given in minutes but we store them as milliseconds
	commandTimeoutFloat, _ := c.Float64("command-timeout")
	commandTimeout := int(commandTimeoutFloat * 1000 * 60)
	noResponseTimeoutFloat, _ := c.Float64("no-response-timeout")
	noResponseTimeout := int(noResponseTimeoutFloat * 1000 * 60)
	shouldArtifacts, _ := c.Bool("artifacts")
	// TODO(termie): switch negative flag
	shouldRemove, _ := c.Bool("no-remove")
	shouldRemove = !shouldRemove
	sourceDir, _ := c.String("source-dir")

	attachOnError, _ := c.Bool("attach-on-error")
	directMount, _ := c.Bool("direct-mount")
	enableDevSteps, _ := c.Bool("enable-dev-steps")
	publishPorts, _ := c.StringSlice("publish")
	enableVolumes, _ := c.Bool("enable-volumes")
	werckerYml, _ := c.String("wercker-yml")

	return &PipelineOptions{
		GlobalOptions: globalOpts,
		AWSOptions:    awsOpts,
		// DockerOptions:   dockerOpts,
		GitOptions:      gitOpts,
		KeenOptions:     keenOpts,
//.........這裏部分代碼省略.........
開發者ID:umcodemonkey,項目名稱:wercker,代碼行數:101,代碼來源:options.go


注:本文中的github.com/wercker/wercker/util.Settings.Float64方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。