commands

package
v0.0.0-...-0e2b5c9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPrompt is the default prompt to be displayed in interactive mode
	DefaultPrompt = "c2cli➩  "
)

Variables

View Source
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

func NewInteractiveCommand(rootCommand cli.Command, version string) cli.Command

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL