cmd

package
v0.4.31 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: GPL-3.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmd

func NewCmd(runner Runner) *cobra.Command

func WaitInterrupted added in v0.4.1

func WaitInterrupted(ctx context.Context) error

Types

type AppContext added in v0.4.12

type AppContext struct {
	// Name holds the current application name.
	Name string
	// ConfigPath holds the current application's config path, if any.
	ConfigPath string
	// Version holds string representation of a current application's version.
	Version string
}

AppContext represents the application context.

func (*AppContext) RunWithHomeExpand added in v0.4.12

func (m *AppContext) RunWithHomeExpand(runner Runner) error

RunWithHomeExpand runs the given runner, expanding the config path field by taking in action HOME directory symbol (~) if it exists.

type Runner

type Runner func(appContext AppContext) error

Runner func starts service wrapper by Cobra command.

Jump to

Keyboard shortcuts

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