commands

package
v2.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package commands contains various files for adding commands and subcommands to romana command line tools.

Each file in the package directory contains exactly one command and multiple sub-commands for it, except the root.go file which initializes the config and cli package and sets various command line parameters.

The package used for configuration is called viper and it allows configuration to be read from configuration files or to be set from command line parameters.

The package used for command line interface is called cobra and it is the main library behind providing usage, flag support and various other command line features.

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cli.Command{
	Use:   "romana",
	Short: "Command line tools for romana services.",
	Long: `Command line tools for romana services.

For more information, please check http://romana.io
`,
}

RootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd. Here commands/subcommand mapping is added where control is passed around from main() to commands/subcommands evoked.

func JSONFormat

func JSONFormat(b []byte, w io.Writer)

JSONFormat indents input json b and writes it to output writer w.

Types

type Error

type Error struct {
	Code    int32
	Message string
	Fields  string
}

type Error contains information for json formatted output in cli.

func (Error) Error

func (e Error) Error() string

type Policies

type Policies struct {
	SecurityPolicies    []api.Policy
	AppliedSuccessfully []bool
}

Policies structure is used to keep track of security policies and their status, as to if they were applied successfully or not.

Jump to

Keyboard shortcuts

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