github.com/criteo-forks/consul@v1.4.5-criteonogrpc/command/intention/intention.go (about) 1 package intention 2 3 import ( 4 "github.com/hashicorp/consul/command/flags" 5 "github.com/mitchellh/cli" 6 ) 7 8 func New() *cmd { 9 return &cmd{} 10 } 11 12 type cmd struct{} 13 14 func (c *cmd) Run(args []string) int { 15 return cli.RunResultHelp 16 } 17 18 func (c *cmd) Synopsis() string { 19 return synopsis 20 } 21 22 func (c *cmd) Help() string { 23 return flags.Usage(help, nil) 24 } 25 26 const synopsis = "Interact with Connect service intentions" 27 const help = ` 28 Usage: consul intention <subcommand> [options] [args] 29 30 This command has subcommands for interacting with intentions. Intentions 31 are permissions describing which services are allowed to communicate via 32 Connect. Here are some simple examples, and more detailed examples are 33 available in the subcommands or the documentation. 34 35 Create an intention to allow "web" to talk to "db": 36 37 $ consul intention create web db 38 39 Test whether a "web" is allowed to connect to "db": 40 41 $ consul intention check web db 42 43 Find all intentions for communicating to the "db" service: 44 45 $ consul intention match db 46 47 For more examples, ask for subcommand help or view the documentation. 48 `