cmdcobra

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ProfileHeapOutput is the flag value.
	ProfileHeapOutput string
	// ProfileCPUOutput is the flag value.
	ProfileCPUOutput string
)

Functions

func ProfileCPURun

func ProfileCPURun() error

ProfileCPURun is a prerun func for starting CPU profile.

func ProfileHeapRun

func ProfileHeapRun() error

ProfileHeapRun is a prerun func for starting heap profile.

Types

type Runs

type Runs struct {
	Mutex sync.Mutex
	List  []func() error
}

Runs keeps a list of funcs.

var (
	// PersistentPostRuns keeps a list of funcs to be cobra.Command's PersistentPostRunE.
	PersistentPostRuns Runs
	// PersistentPreRuns keeps a list of funcs to be cobra.Command's PersistentPreRunEE.
	PersistentPreRuns Runs
	// PreRuns keeps a list of funcs to be cobra.Command's PreRunE.
	PreRuns Runs
)

func (*Runs) Add

func (rs *Runs) Add(f func() error)

Add appends f to rs.List.

func (*Runs) RunE

func (rs *Runs) RunE(*cobra.Command, []string) error

RunE runs rs.List entries.

Jump to

Keyboard shortcuts

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