Documentation ¶
Index ¶
- Constants
- Variables
- func NewAttachCommand(c2ClientFactory cli.APIClientFactory) cli.Command
- func NewCountCommand(c2ClientFactory cli.APIClientFactory) cli.Command
- func NewDetachCommand(c2ClientFactory cli.APIClientFactory) cli.Command
- func NewEventsCommand(c2ClientFactory cli.APIClientFactory) cli.Command
- func NewInteractiveCommand(rootCommand cli.Command, version string) cli.Command
- func NewNewC2KeyCommand(c2ClientFactory cli.APIClientFactory) cli.Command
- func NewProtectMessageCommand(c2ClientFactory cli.APIClientFactory) cli.Command
- func NewRootCommand(c2ClientFactory cli.APIClientFactory, version string) cli.Command
- func NewUnprotectMessageCommand(c2ClientFactory cli.APIClientFactory) cli.Command
- type CompletionCommand
Constants ¶
const (
// DefaultPrompt is the default prompt to be displayed in interactive mode
DefaultPrompt = "c2cli➩ "
)
Variables ¶
var ( // BlacklistedCobraCommands defines a list of cobra command names to be filtered out when running in interactive mode BlacklistedCobraCommands = []string{"c2cli", "help", "completion", "interactive"} )
Functions ¶
func NewAttachCommand ¶
func NewAttachCommand(c2ClientFactory cli.APIClientFactory) cli.Command
NewAttachCommand creates a new command allowing to attach a client to a topic
func NewCountCommand ¶
func NewCountCommand(c2ClientFactory cli.APIClientFactory) cli.Command
NewCountCommand creates a new command allowing to count clients, topics, clients for topics or topics for clients
func NewDetachCommand ¶
func NewDetachCommand(c2ClientFactory cli.APIClientFactory) cli.Command
NewDetachCommand creates a new command allowing to detach a client from a topic
func NewEventsCommand ¶
func NewEventsCommand(c2ClientFactory cli.APIClientFactory) cli.Command
NewEventsCommand creates a new command allowing to subscribe to C2 server event stream events will get printed on the command output (stdout by default)
func NewInteractiveCommand ¶
NewInteractiveCommand returns a command enabling interactive mode
func NewNewC2KeyCommand ¶
func NewNewC2KeyCommand(c2ClientFactory cli.APIClientFactory) cli.Command
NewNewC2KeyCommand returns a new command to change the C2 keys, and send the new public key to all clients
func NewProtectMessageCommand ¶
func NewProtectMessageCommand(c2ClientFactory cli.APIClientFactory) cli.Command
NewProtectMessageCommand returns a new command to protect a given message with a topic key
func NewRootCommand ¶
func NewRootCommand(c2ClientFactory cli.APIClientFactory, version string) cli.Command
NewRootCommand creates and configure a new cli root command
func NewUnprotectMessageCommand ¶
func NewUnprotectMessageCommand(c2ClientFactory cli.APIClientFactory) cli.Command
NewUnprotectMessageCommand returns a new command to unprotect a given message with a topic key
Types ¶
type CompletionCommand ¶
type CompletionCommand struct {
// contains filtered or unexported fields
}
CompletionCommand defines a custom Command to deal with auto completion
func NewCompletionCommand ¶
func NewCompletionCommand(rootCommand cli.Command) *CompletionCommand
NewCompletionCommand returns the cobra command used to generate the autocompletion
func (*CompletionCommand) CobraCmd ¶
func (c *CompletionCommand) CobraCmd() *cobra.Command
CobraCmd returns the cobra command
func (*CompletionCommand) GenerateCustomCompletionFuncs ¶
func (c *CompletionCommand) GenerateCustomCompletionFuncs() string
GenerateCustomCompletionFuncs returns the bash script snippets to use for custom autocompletion