cli

package
v0.0.0-...-c9337a5 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main()

func Version

func Version() cli.Command

Types

type AgentCommand

type AgentCommand struct {
	// contains filtered or unexported fields
}

AgentCommand implements agent subcommand.

func (*AgentCommand) Cmd

func (b *AgentCommand) Cmd() *cobra.Command

func (*AgentCommand) Init

func (a *AgentCommand) Init(c *Cli)

Init initialize agent commands

type Cli

type Cli struct {
	// contains filtered or unexported fields
}

Cli is the entrance of nap, it manage all commands.

func NewCli

func NewCli() *Cli

NewCli creeates an instance of Cli.

func (*Cli) AddCommand

func (c *Cli) AddCommand(parent, child Command)

AddCommand add a subcommand.

func (*Cli) Run

func (c *Cli) Run() error

Run executes the nap program.

type Command

type Command interface {
	Init(*Cli)
	Cmd() *cobra.Command
}

Command define some interfaces that the command must implement them.

type MasterCommand

type MasterCommand struct {
	// contains filtered or unexported fields
}

MasterCommand implements master subcommand.

func (*MasterCommand) Cmd

func (b *MasterCommand) Cmd() *cobra.Command

func (*MasterCommand) Init

func (m *MasterCommand) Init(c *Cli)

Init initialize master commands

type VersionCommand

type VersionCommand struct {
	// contains filtered or unexported fields
}

VersionCommand implements version subcommand.

func (*VersionCommand) Cmd

func (b *VersionCommand) Cmd() *cobra.Command

func (*VersionCommand) Init

func (v *VersionCommand) Init(c *Cli)

Jump to

Keyboard shortcuts

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