cmd

package
v2.1.7+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Log is the package logger

View Source
var RootCmd = &cobra.Command{
	Use:   "ari-proxy",
	Short: "Proxy for the Asterisk REST interface.",
	Long: `ari-proxy is a proxy for working the Asterisk daemon over NATS.
	ARI commands are exposed over NATS for operation.`,
	RunE: func(cmd *cobra.Command, args []string) error {
		ctx, cancel := context.WithCancel(context.Background())
		defer cancel()

		var handler = log15.StdoutHandler
		if viper.GetBool("verbose") {
			Log.Info("Verbose logging enabled")
			handler = log15.LvlFilterHandler(log15.LvlDebug, handler)
		} else {
			handler = log15.LvlFilterHandler(log15.LvlInfo, handler)
		}
		Log.SetHandler(handler)

		native.Logger.SetHandler(handler)

		return runServer(ctx, Log)
	},
}

RootCmd is the Cobra root command descriptor

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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