cmd

package
v0.0.0-...-b13eba1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Start program start command.
	Start = cli.Command{

		Name: "start",

		Aliases: []string{"up"},

		Usage: "FastMQ program start command✅.\n",

		Action: func(c *cli.Context) error {
			app.EchoInfo()
			if isBackgrund {
				logker.Info("%s", "FastMQ is enable daemon mode running.")
				daemon()
				logker.Info("FastMQ PID: %d running", processID)

				time.Sleep(time.Second * 3)
				return nil
			}
			logker.Info("%s", "FastMQ serve start up.")
			mq := app.NewMQServer(conf.LoadOption())
			if err := mq.Start(); err != nil {
				return err
			}

			return nil
		},
	}
	// Stop program stop command.
	Stop = cli.Command{

		Name: "stop",

		Aliases: []string{"down"},

		Usage: "FastMQ program stop command❎.\n",

		Action: func(c *cli.Context) error {

			kill()
			return nil
		},
	}
)
View Source
var (
	// ErrStartUp START UP ERROR
	ErrStartUp = errors.New("daemon start error")
)

Functions

func Daemon

func Daemon(nochdir, noclose int) (int, error)

Daemon 守护进程

Types

This section is empty.

Jump to

Keyboard shortcuts

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