cmd

package
v0.0.0-...-2b140d7 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CallbackName   string
	ShowHistorical bool
)
View Source
var ClientCommand = &cobra.Command{
	Use:   "client",
	Short: "Run the Hotline client",
	Run: func(cmd *cobra.Command, args []string) {
		cfg := config.LoadConfig(configPath)
		if cfg == nil {
			return
		}

		client.StartClient(CallbackName, ShowHistorical, cfg)
	},
}
View Source
var ServerCommand = &cobra.Command{
	Use:   "server",
	Short: "Run the Hotline server (set $HOTLINE_APP to configure which server to run)",
	Run: func(cmd *cobra.Command, args []string) {
		cfg := config.LoadConfig(configPath)
		if cfg == nil {
			return
		}

		hotlineApp := os.Getenv("HOTLINE_APP")

		switch hotlineApp {
		case "dns":
			log.Println("starting dns callback server")

			dns.StartServer(cfg)
		case "http":
			log.Println("starting http callback server")

			http.StartServer(cfg)
		case "web":
			log.Println("starting web server")

			web.StartApp(cfg)
		default:
			log.Fatalln("failed to launch server: you must set $HOTLINE_APP to dns, http, or web")
		}
	},
}

Functions

func Execute

func Execute()

Types

This section is empty.

Jump to

Keyboard shortcuts

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