command

package
v0.0.0-...-a197711 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PIPEEMTPY = "_PIPE_EMPTY"
)

Input From Pipe/HereDoc

Variables

View Source
var EnvPrefix string

Functions

func CleanUpSignals

func CleanUpSignals()

CleanUpSignals runs all enabled handlers in priority order

func DisableSignalHandler

func DisableSignalHandler(name string)

DisableSignalHandler can Disable SignalHandler by name

func FilePath

func FilePath(file string) (real string, err error)

FilePath gives the real file path. If is a link, gives its origin path.

func RegisterCommand

func RegisterCommand(cmd cli.Command)

RegisterCommand add new Available command

func RegisterSignalHandler

func RegisterSignalHandler(name string, handler SignalHandler, priority int)

RegisterSignalHandler will add @handler to signal callback list

@name: mark for the handler
@handler: callback, returns error.
@priority: all Handlers will run in priority order.
  - `0` has a higher Priority over `1`.

func Run

func Run() error

Run starts app

func RunSignal

func RunSignal()

RunSignal will subscribe to SIGINT and SIGKILL and do CleanUp if triggered

func SetupConfig

func SetupConfig(s *config.Setting)

SetupConfig will add `config` command

func SetupUpdate

func SetupUpdate(src string)

SetupUpdate will add an `update` command, to update self from a http url

func UseCommand

func UseCommand(cmd ...string)

UseCommand tells app which commands it will use

Types

type App

type App struct {
	Pipe     string
	Fifo     string
	FifoFile string
	Args     []string
	*cli.App
}

func Instance

func Instance() *App

Instance returns package variable app

type SignalHandler

type SignalHandler func() error

SignalHandler is handler for SIGINT and SIGKILL

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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