本文整理汇总了Golang中github.com/Masterminds/cookoo.Registry.Route方法的典型用法代码示例。如果您正苦于以下问题:Golang Registry.Route方法的具体用法?Golang Registry.Route怎么用?Golang Registry.Route使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/Masterminds/cookoo.Registry
的用法示例。
在下文中一共展示了Registry.Route方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: routes
func routes(reg *cookoo.Registry, cxt cookoo.Context) {
reg.Route("@startup", "Parse args and send to the right subcommand.").
// TODO: Add setup for debug in addition to quiet.
Does(cmd.BeQuiet, "quiet").
Using("quiet").From("cxt:q").
Does(cmd.VersionGuard, "v")
reg.Route("@ready", "Prepare for glide commands.").
Does(cmd.ReadyToGlide, "ready").Using("filename").From("cxt:yaml").
Does(cmd.ParseYaml, "cfg").Using("filename").From("cxt:yaml")
reg.Route("get", "Install a pkg in vendor, and store the results in the glide.yaml").
Includes("@startup").
Includes("@ready").
Does(cmd.GetAll, "goget").
Using("filename").From("cxt:yaml").
Using("packages").From("cxt:packages").
Using("conf").From("cxt:cfg").
Does(cmd.MergeToYaml, "merged").Using("conf").From("cxt:cfg").
Does(cmd.Recurse, "recurse").Using("conf").From("cxt:cfg").
Using("enable").From("cxt:recursiveDependencies").
Using("importGodeps").From("cxt:importGodeps").
Using("importGPM").From("cxt:importGPM").
Using("importGb").From("cxt:importGb").
Using("force").From("cxt:forceUpdate").WithDefault(false).
Using("packages").From("cxt:packages").
Does(cmd.WriteYaml, "out").
Using("yaml.Node").From("cxt:merged").
Using("filename").WithDefault("glide.yaml").From("cxt:yaml")
reg.Route("exec", "Execute command with GOPATH set.").
Includes("@startup").
Includes("@ready").
Does(cmd.ExecCmd, "cmd").
Using("args").From("cxt:cliArgs").
Using("filename").From("cxt:yaml")
reg.Route("update", "Update dependencies.").
Includes("@startup").
Includes("@ready").
Does(cmd.CowardMode, "_").
Does(cmd.Mkdir, "dir").Using("dir").WithDefault(VendorDir).
Does(cmd.DeleteUnusedPackages, "deleted").
Using("conf").From("cxt:cfg").
Using("optIn").From("cxt:deleteOptIn").
Does(cmd.VendoredSetup, "cfg").
Using("conf").From("cxt:cfg").
Using("update").From("cxt:updateVendoredDeps").
Does(cmd.UpdateImports, "dependencies").
Using("conf").From("cxt:cfg").
Using("force").From("cxt:forceUpdate").
Using("packages").From("cxt:packages").
Does(cmd.SetReference, "version").Using("conf").From("cxt:cfg").
Does(cmd.Recurse, "recurse").Using("conf").From("cxt:cfg").
Using("deleteFlatten").From("cxt:deleteFlatten").
Using("importGodeps").From("cxt:importGodeps").
Using("importGPM").From("cxt:importGPM").
Using("importGb").From("cxt:importGb").
Using("enable").From("cxt:recursiveDependencies").
Using("force").From("cxt:forceUpdate").
Using("packages").From("cxt:packages").
Does(cmd.VendoredCleanUp, "_").
Using("conf").From("cxt:cfg").
Using("update").From("cxt:updateVendoredDeps")
//Does(cmd.Rebuild, "rebuild").Using("conf").From("cxt:cfg")
reg.Route("rebuild", "Rebuild dependencies").
Includes("@startup").
Includes("@ready").
Does(cmd.CowardMode, "_").
Does(cmd.Rebuild, "rebuild").Using("conf").From("cxt:cfg")
reg.Route("pin", "Print a YAML file with all of the packages pinned to the current version.").
Includes("@startup").
Includes("@ready").
Does(cmd.UpdateReferences, "refs").Using("conf").From("cxt:cfg").
Does(cmd.MergeToYaml, "merged").Using("conf").From("cxt:cfg").
Does(cmd.WriteYaml, "out").
Using("yaml.Node").From("cxt:merged").
Using("filename").From("cxt:toPath")
reg.Route("import gpm", "Read a Godeps file").
Includes("@startup").
Includes("@ready").
Does(cmd.GPMGodeps, "godeps").
Does(cmd.AddDependencies, "addGodeps").
Using("dependencies").From("cxt:godeps").
Using("conf").From("cxt:cfg").
Does(cmd.GPMGodepsGit, "godepsGit").
Does(cmd.AddDependencies, "addGodepsGit").
Using("dependencies").From("cxt:godepsGit").
Using("conf").From("cxt:cfg").
// Does(cmd.UpdateReferences, "refs").Using("conf").From("cxt:cfg").
Does(cmd.MergeToYaml, "merged").Using("conf").From("cxt:cfg").
Does(cmd.WriteYaml, "out").Using("yaml.Node").From("cxt:merged")
reg.Route("import godep", "Read a Godeps.json file").
Includes("@startup").
Includes("@ready").
//.........这里部分代码省略.........
示例2: routes
func routes(reg *cookoo.Registry, cxt cookoo.Context) {
reg.Route("@startup", "Parse args and send to the right subcommand.").
// TODO: Add setup for debug in addition to quiet.
Does(cmd.BeQuiet, "quiet").
Using("quiet").From("cxt:q").
Using("debug").From("cxt:debug").
Does(cmd.CheckColor, "no-color").
Using("no-color").From("cxt:no-color").
Does(cmd.VersionGuard, "v")
reg.Route("@ready", "Prepare for glide commands.").
Does(cmd.ReadyToGlide, "ready").Using("filename").From("cxt:yaml").
Does(cmd.ParseYaml, "cfg").Using("filename").From("cxt:yaml").
Does(cmd.EnsureCacheDir, "_").Using("home").From("cxt:home")
reg.Route("get", "Install a pkg in vendor, and store the results in the glide.yaml").
Includes("@startup").
Includes("@ready").
Does(cmd.CowardMode, "_").
Does(cmd.GetAll, "goget").
Using("packages").From("cxt:packages").
Using("conf").From("cxt:cfg").
Using("insecure").From("cxt:insecure").
Does(cmd.VendoredSetup, "cfg").
Using("conf").From("cxt:cfg").
Using("update").From("cxt:updateVendoredDeps").
Does(cmd.UpdateImports, "dependencies").
Using("conf").From("cxt:cfg").
Using("force").From("cxt:forceUpdate").
//Using("packages").From("cxt:packages").
Using("home").From("cxt:home").
Using("cache").From("cxt:useCache").
Using("cacheGopath").From("cxt:cacheGopath").
Using("useGopath").From("cxt:useGopath").
Does(cmd.SetReference, "version").Using("conf").From("cxt:cfg").
Does(cmd.Flatten, "flattened").Using("conf").From("cxt:cfg").
//Using("packages").From("cxt:packages").
Using("force").From("cxt:forceUpdate").
Using("home").From("cxt:home").
Using("cache").From("cxt:useCache").
Using("cacheGopath").From("cxt:cacheGopath").
Using("useGopath").From("cxt:useGopath").
Does(cmd.VendoredCleanUp, "_").
Using("conf").From("cxt:flattened").
Using("update").From("cxt:updateVendoredDeps").
Does(cmd.WriteYaml, "out").
Using("conf").From("cxt:cfg").
Using("filename").WithDefault("glide.yaml").From("cxt:yaml").
Does(cmd.WriteLock, "lock").
Using("lockfile").From("cxt:Lockfile")
reg.Route("install", "Install dependencies.").
Includes("@startup").
Includes("@ready").
Does(cmd.CowardMode, "_").
Does(cmd.LockFileExists, "_").
Does(cmd.LoadLockFile, "lock").
Using("conf").From("cxt:cfg").
Does(cmd.Mkdir, "dir").Using("dir").WithDefault(VendorDir).
Does(cmd.DeleteUnusedPackages, "deleted").
Using("conf").From("cxt:cfg").
Using("optIn").From("cxt:deleteOptIn").
Does(cmd.VendoredSetup, "cfg").
Using("conf").From("cxt:cfg").
Using("update").From("cxt:updateVendoredDeps").
Does(cmd.Install, "icfg").
Using("conf").From("cxt:cfg").
Using("lock").From("cxt:lock").
Using("home").From("cxt:home").
Does(cmd.SetReference, "version").Using("conf").From("cxt:icfg").
Does(cmd.VendoredCleanUp, "_").
Using("conf").From("cxt:icfg").
Using("update").From("cxt:updateVendoredDeps")
reg.Route("update", "Update dependencies.").
Includes("@startup").
Includes("@ready").
Does(cmd.CowardMode, "_").
Does(cmd.Mkdir, "dir").Using("dir").WithDefault(VendorDir).
Does(cmd.DeleteUnusedPackages, "deleted").
Using("conf").From("cxt:cfg").
Using("optIn").From("cxt:deleteOptIn").
Does(cmd.VendoredSetup, "cfg").
Using("conf").From("cxt:cfg").
Using("update").From("cxt:updateVendoredDeps").
Does(cmd.UpdateImports, "dependencies").
Using("conf").From("cxt:cfg").
Using("force").From("cxt:forceUpdate").
Using("packages").From("cxt:packages").
Using("home").From("cxt:home").
Using("cache").From("cxt:useCache").
Using("cacheGopath").From("cxt:cacheGopath").
Using("useGopath").From("cxt:useGopath").
Does(cmd.SetReference, "version").Using("conf").From("cxt:cfg").
Does(cmd.Flatten, "flattened").Using("conf").From("cxt:cfg").
//Using("packages").From("cxt:packages").
Using("force").From("cxt:forceUpdate").
Using("skip").From("cxt:skipFlatten").
Using("home").From("cxt:home").
Using("cache").From("cxt:useCache").
//.........这里部分代码省略.........