当前位置: 首页>>代码示例>>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;未经允许,请勿转载。