本文整理汇总了Golang中github.com/aws/amazon-ecs-cli/ecs-cli/modules/compose/ecs.Context类的典型用法代码示例。如果您正苦于以下问题:Golang Context类的具体用法?Golang Context怎么用?Golang Context使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Context类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: populateLibcomposeContext
// populateLibcomposeContext sets the required Libcompose lookup utilities to the context
func (projectFactory projectFactory) populateLibcomposeContext(ecsContext *ecscompose.Context) error {
envLookup, err := utils.GetDefaultEnvironmentLookup()
if err != nil {
return err
}
ecsContext.EnvironmentLookup = envLookup
resourceLookup, err := utils.GetDefaultResourceLookup()
if err != nil {
return err
}
ecsContext.ResourceLookup = resourceLookup
return nil
}
开发者ID:uttarasridhar,项目名称:amazon-ecs-cli,代码行数:15,代码来源:factory.go
示例3: populate
// populate updates the specified ecs context based on command line arguments and subcommands.
func populate(ecsContext *ecscompose.Context, cliContext *cli.Context) {
// TODO: Support multiple compose files
ecsContext.ComposeFiles = []string{cliContext.GlobalString(composeFileNameFlag)}
ecsContext.ProjectName = cliContext.GlobalString(ecscompose.ProjectNameFlag)
}
开发者ID:uttarasridhar,项目名称:amazon-ecs-cli,代码行数:6,代码来源:command.go
示例4: populate
// populate updates the specified ecs context based on command line arguments and subcommands.
func populate(ecsContext *ecscompose.Context, cliContext *cli.Context) {
ecsContext.ComposeFile = cliContext.GlobalString(composeFileNameFlag)
ecsContext.ProjectName = cliContext.GlobalString(projectNameFlag)
}
开发者ID:jloper3,项目名称:amazon-ecs-cli,代码行数:5,代码来源:command.go
注:本文中的github.com/aws/amazon-ecs-cli/ecs-cli/modules/compose/ecs.Context类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论