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


Golang ecs.Project類代碼示例

本文整理匯總了Golang中github.com/aws/amazon-ecs-cli/ecs-cli/modules/compose/ecs.Project的典型用法代碼示例。如果您正苦於以下問題:Golang Project類的具體用法?Golang Project怎麽用?Golang Project使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: ProjectPs

// ProjectPs lists the containers.
func ProjectPs(p ecscompose.Project, c *cli.Context) {
	allInfo, err := p.Info()
	if err != nil {
		log.Fatal(err)
	}
	os.Stdout.WriteString(allInfo.String())
}
開發者ID:jloper3,項目名稱:amazon-ecs-cli,代碼行數:8,代碼來源:app.go

示例2: loadProject

// loadProject opens the project by loading configs
func (projectFactory projectFactory) loadProject(project ecscompose.Project) error {
	err := project.Parse()
	if err != nil {
		utils.LogError(err, "Unable to open ECS Compose Project")
	}
	return err
}
開發者ID:jloper3,項目名稱:amazon-ecs-cli,代碼行數:8,代碼來源:factory.go

示例3: ProjectPs

// ProjectPs lists the containers.
func ProjectPs(p ecscompose.Project, c *cli.Context) {
	allInfo, err := p.Info()
	if err != nil {
		log.Fatal(err)
	}
	os.Stdout.WriteString(allInfo.String(ecscompose.ContainerInfoColumns, displayTitle))
}
開發者ID:uttarasridhar,項目名稱:amazon-ecs-cli,代碼行數:8,代碼來源:app.go

示例4: ProjectScale

// ProjectScale scales containers.
func ProjectScale(p ecscompose.Project, c *cli.Context) {
	if len(c.Args()) != 1 {
		log.Fatal("Please pass arguments in the form: ecs-cli compose scale COUNT")
	}
	count, err := strconv.Atoi(c.Args().First())
	if err != nil {
		log.Fatal("Please pass an integer value for argument COUNT")
	}
	err = p.Scale(count)
	if err != nil {
		log.Fatal(err)
	}
}
開發者ID:jloper3,項目名稱:amazon-ecs-cli,代碼行數:14,代碼來源:app.go

示例5: ProjectRun

// ProjectRun starts containers and executes one-time command against the container
func ProjectRun(p ecscompose.Project, c *cli.Context) {
	args := c.Args()
	if len(args)%2 != 0 {
		log.Fatal("Please pass arguments in the form: CONTAINER COMMAND [CONTAINER COMMAND]...")
	}
	commandOverrides := make(map[string]string)
	for i := 0; i < len(args); i += 2 {
		commandOverrides[args[i]] = args[i+1]
	}
	err := p.Run(commandOverrides)
	if err != nil {
		log.Fatal(err)
	}
}
開發者ID:jloper3,項目名稱:amazon-ecs-cli,代碼行數:15,代碼來源:app.go

示例6: ProjectUp

// ProjectUp brings all containers up.
func ProjectUp(p ecscompose.Project, c *cli.Context) {
	err := p.Up()
	if err != nil {
		log.Fatal(err)
	}
}
開發者ID:jloper3,項目名稱:amazon-ecs-cli,代碼行數:7,代碼來源:app.go

示例7: ProjectCreate

// ProjectCreate creates the task definition required for the containers but does not start them.
func ProjectCreate(p ecscompose.Project, c *cli.Context) {
	err := p.Create()
	if err != nil {
		log.Fatal(err)
	}
}
開發者ID:jloper3,項目名稱:amazon-ecs-cli,代碼行數:7,代碼來源:app.go


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