本文整理汇总了Golang中github.com/docker/libcompose/cli/app.WithProject函数的典型用法代码示例。如果您正苦于以下问题:Golang WithProject函数的具体用法?Golang WithProject怎么用?Golang WithProject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了WithProject函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: PsCommand
func PsCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "ps",
Usage: "List containers",
Action: app.WithProject(factory, app.ProjectPs),
}
}
示例2: PullCommand
// PullCommand defines the libcompose pull subcommand.
func PullCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "pull",
Usage: "Pulls images for services",
Action: app.WithProject(factory, app.ProjectPull),
}
}
示例3: UpCommand
// UpCommand defines the libcompose up subcommand.
func UpCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "up",
Usage: "Bring all services up",
Action: app.WithProject(factory, app.ProjectUp),
Flags: []cli.Flag{
cli.BoolFlag{
Name: "d",
Usage: "Do not block and log",
},
cli.BoolFlag{
Name: "no-build",
Usage: "Don't build an image, even if it's missing.",
},
cli.BoolFlag{
Name: "no-recreate",
Usage: "If containers already exist, don't recreate them. Incompatible with --force-recreate.",
},
cli.BoolFlag{
Name: "force-recreate",
Usage: "Recreate containers even if their configuration and image haven't changed. Incompatible with --no-recreate.",
},
},
}
}
示例4: BuildCommand
// BuildCommand defines the libcompose build subcommand.
func BuildCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "build",
Usage: "Build or rebuild services.",
Action: app.WithProject(factory, app.ProjectBuild),
}
}
示例5: CreateCommand
// CreateCommand defines the libcompose create subcommand.
func CreateCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "create",
Usage: "Create all services but do not start",
Action: app.WithProject(factory, app.ProjectCreate),
}
}
示例6: UnpauseCommand
// UnpauseCommand defines the libcompose unpause subcommand.
func UnpauseCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "unpause",
Usage: "Unpause services.",
// ArgsUsage: "[SERVICE...]",
Action: app.WithProject(factory, app.ProjectUnpause),
}
}
示例7: DownCommand
// DownCommand defines the libcompose stop subcommand.
func DownCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "down",
Usage: "Stop and remove containers, networks, images, and volumes",
Action: app.WithProject(factory, app.ProjectDown),
Flags: []cli.Flag{},
}
}
示例8: RunCommand
// RunCommand defines the libcompose run subcommand.
func RunCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "run",
Usage: "Run a one-off command",
Action: app.WithProject(factory, app.ProjectRun),
Flags: []cli.Flag{},
}
}
示例9: PullCommand
// PullCommand defines the libcompose pull subcommand.
func PullCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "pull",
Usage: "Pulls images for services",
Action: app.WithProject(factory, app.ProjectPull),
Flags: []cli.Flag{
cli.BoolFlag{
Name: "ignore-pull-failures",
Usage: "Pull what it can and ignores images with pull failures.",
},
},
}
}
示例10: UpCommand
func UpCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "up",
Usage: "Bring all services up",
Action: app.WithProject(factory, app.ProjectUp),
Flags: []cli.Flag{
cli.BoolFlag{
Name: "d",
Usage: "Do not block and log",
},
},
}
}
示例11: ConfigCommand
// ConfigCommand defines the libcompose config subcommand
func ConfigCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "config",
Usage: "Validate and view the compose file.",
Action: app.WithProject(factory, app.ProjectConfig),
Flags: []cli.Flag{
cli.BoolFlag{
Name: "quiet,q",
Usage: "Only validate the configuration, don't print anything.",
},
},
}
}
示例12: LogsCommand
// LogsCommand defines the libcompose logs subcommand.
func LogsCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "logs",
Usage: "Get service logs",
Action: app.WithProject(factory, app.ProjectLog),
Flags: []cli.Flag{
cli.BoolFlag{
Name: "follow",
Usage: "Follow log output.",
},
},
}
}
示例13: RmCommand
func RmCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "rm",
Usage: "Delete services",
Action: app.WithProject(factory, app.ProjectDelete),
Flags: []cli.Flag{
cli.BoolFlag{
Name: "force,f",
Usage: "Allow deletion of all services",
},
},
}
}
示例14: PsCommand
// PsCommand defines the libcompose ps subcommand.
func PsCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "ps",
Usage: "List containers",
Action: app.WithProject(factory, app.ProjectPs),
Flags: []cli.Flag{
cli.BoolFlag{
Name: "q",
Usage: "Only display IDs",
},
},
}
}
示例15: RunCommand
// RunCommand defines the libcompose run subcommand.
func RunCommand(factory app.ProjectFactory) cli.Command {
return cli.Command{
Name: "run",
Usage: "Run a one-off command",
Action: app.WithProject(factory, app.ProjectRun),
Flags: []cli.Flag{
cli.BoolFlag{
Name: "d",
Usage: "Detached mode: Run container in the background, print new container name.",
},
},
}
}