commands

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmailctlVersion = emailctl.Version{
	Major: 0,
	Minor: 2,
	Patch: 0,
}

EmailctlVersion is emailctl's version.

Functions

func CleanAuth

func CleanAuth()

CleanAuth removes saved authentication tokens

func Execute

func Execute()

Execute adds all child commands to the root command sets flags appropriately.

func SaveAuth

func SaveAuth(login, token, refreshToken string) error

SaveAuth writes active authentication tokens to the configuration file

Types

type Command

type Command struct {
	*cobra.Command
}

Command is a wrapper for cobra.Command.

func BuildCommand

func BuildCommand(parent *Command, runner CommandRunner, usage, description string, options ...CommandOption) *Command

BuildCommand creates a new Command.

func CreateAccountCommand

func CreateAccountCommand() *Command

CreateAccountCommand creates an account command with all its sub-commands.

func CreateAliasCommand

func CreateAliasCommand() *Command

CreateAliasCommand creates an alias command with all its sub-commands.

func CreateAuthCommand

func CreateAuthCommand() *Command

CreateAuthCommand creates an auth command with its subcommands.

func CreateDomainCommand

func CreateDomainCommand() *Command

CreateDomainCommand creates a domain command with all its sub-commands.

func CreateRecipientBccCommand

func CreateRecipientBccCommand() *Command

CreateRecipientBccCommand creates the recipient-bcc command and its sub-commands.

func CreateSenderBccCommand

func CreateSenderBccCommand() *Command

CreateSenderBccCommand creates the sender-bcc command and its sub-commands.

func CreateVersionCommand

func CreateVersionCommand() *Command

CreateVersionCommand creates a version command

func (*Command) AddCommand

func (c *Command) AddCommand(commands ...*Command)

AddCommand add child commands to the Command.

type CommandOption

type CommandOption func(*Command)

CommandOption is an option to Command.

func AliasOption

func AliasOption(alias string) CommandOption

AliasOption returns a CommandOption that sets an alias to the command.

func ArgsOption

func ArgsOption(n int) CommandOption

ArgsOption returns a CommandOption that returns an error if there are not exactly n arguments.

func ArgsRangeOption

func ArgsRangeOption(min, max int) CommandOption

ArgsRangeOption returns a CommandOption that returns an error if number of arguments passed to command is less than `min` or greater than `max`.

type CommandRunner

type CommandRunner func(*emailctl.Client, []string) error

CommandRunner runs a Command using the provider client and args.

Jump to

Keyboard shortcuts

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