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


Golang config.NewReadWriter函數代碼示例

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


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

示例1: populateContext

// populateContext sets the required CLI arguments to the context
func (projectFactory projectFactory) populateContext(ecsContext *ecscompose.Context, cliContext *cli.Context) error {
	// populate CLI context
	populate(ecsContext, cliContext)
	ecsContext.CLIContext = cliContext

	// reads and sets the parameters (required to create ECS Service Client) from the cli context to ecs context
	rdwr, err := config.NewReadWriter()
	if err != nil {
		utils.LogError(err, "Error loading config")
		return err
	}
	params, err := config.NewCliParams(cliContext, rdwr)
	if err != nil {
		utils.LogError(err, "Unable to create an instance of ECSParams given the cli context")
		return err
	}
	ecsContext.ECSParams = params

	// populate libcompose context
	if err = projectFactory.populateLibcomposeContext(ecsContext); err != nil {
		return err
	}

	return nil
}
開發者ID:uttarasridhar,項目名稱:amazon-ecs-cli,代碼行數:26,代碼來源:factory.go

示例2: ClusterScale

func ClusterScale(c *cli.Context) {
	rdwr, err := config.NewReadWriter()
	if err != nil {
		logrus.Error("Error executing 'scale': ", err)
		return
	}

	ecsClient := ecsclient.NewECSClient()
	cfnClient := cloudformation.NewCloudformationClient()
	if err := scaleCluster(c, rdwr, ecsClient, cfnClient); err != nil {
		logrus.Error("Error executing 'scale': ", err)
		return
	}
}
開發者ID:uttarasridhar,項目名稱:amazon-ecs-cli,代碼行數:14,代碼來源:cluster_app.go

示例3: ClusterPS

func ClusterPS(c *cli.Context) {
	rdwr, err := config.NewReadWriter()
	if err != nil {
		logrus.Error("Error executing 'ps ", err)
		return
	}

	ecsClient := ecsclient.NewECSClient()
	infoSet, err := clusterPS(c, rdwr, ecsClient)
	if err != nil {
		logrus.Error("Error executing 'ps ", err)
		return
	}
	os.Stdout.WriteString(infoSet.String(ecscompose.ContainerInfoColumns, displayTitle))
}
開發者ID:uttarasridhar,項目名稱:amazon-ecs-cli,代碼行數:15,代碼來源:cluster_app.go

示例4: ClusterUp

func ClusterUp(c *cli.Context) {
	rdwr, err := config.NewReadWriter()
	if err != nil {
		logrus.Error("Error executing 'up': ", err)
		return
	}

	ecsClient := ecsclient.NewECSClient()
	cfnClient := cloudformation.NewCloudformationClient()
	amiIds := ami.NewStaticAmiIds()
	if err := createCluster(c, rdwr, ecsClient, cfnClient, amiIds); err != nil {
		logrus.Error("Error executing 'up': ", err)
		return
	}
}
開發者ID:uttarasridhar,項目名稱:amazon-ecs-cli,代碼行數:15,代碼來源:cluster_app.go

示例5: configure

// configure is the callback for ConfigureCommand.
func configure(context *cli.Context) {
	ecsConfig, err := createECSConfigFromCli(context)
	if err != nil {
		logrus.Error("Error initializing: ", err)
		return
	}
	rdwr, err := config.NewReadWriter()
	if err != nil {
		logrus.Error("Error initializing: ", err)
		return
	}
	err = saveConfig(ecsConfig, rdwr, rdwr.Destination)
	if err != nil {
		logrus.Error("Error initializing: ", err)
	}
}
開發者ID:skion,項目名稱:amazon-ecs-cli,代碼行數:17,代碼來源:configure.go


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