cmd

package
v1.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version   = "develop"
	BuildDate = "-"
	Commit    = "-"
)
View Source
var UICmd = &cobra.Command{
	Use: "ui",
	Run: func(cmd *cobra.Command, args []string) {
		addr := viper.GetString("ui.http.bind_address")

		handler := http.FileServer(http.FS(uipath))

		http.HandleFunc("/", func(rw http.ResponseWriter, r *http.Request) {
			isFile := regexp.MustCompile(`\.[a-z]{2,}$`)
			path := r.URL.Path
			if !isFile.MatchString(path) {
				path = "/"
			}
			r.URL.Path = fmt.Sprintf("/control%s", path)

			handler.ServeHTTP(rw, r)
		})

		openuri(addr)
		fmt.Printf("Numary control is live on http://%s\n", addr)

		http.ListenAndServe(addr, nil)
	},
}

Functions

func Execute

func Execute()

func NewConfig

func NewConfig() *cobra.Command

func NewConfigInit

func NewConfigInit() *cobra.Command

func NewContainer

func NewContainer(v *viper.Viper, options ...fx.Option) *fx.App

func NewRootCommand

func NewRootCommand() *cobra.Command

func NewScriptCheck

func NewScriptCheck() *cobra.Command

func NewScriptExec

func NewScriptExec() *cobra.Command

func NewServer

func NewServer() *cobra.Command

func NewServerStart

func NewServerStart() *cobra.Command

func NewStorage

func NewStorage() *cobra.Command

func NewStorageInit

func NewStorageInit() *cobra.Command

func NewVersion

func NewVersion() *cobra.Command

func PrintVersion

func PrintVersion(cmd *cobra.Command, args []string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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