cmd

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: MIT Imports: 46 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ServiceName = "ledger"

Variables

View Source
var (
	Version                = "develop"
	BuildDate              = "-"
	Commit                 = "-"
	DefaultSegmentWriteKey = ""
)
View Source
var UICmd = &cobra.Command{
	Use: "ui",
	RunE: func(cmd *cobra.Command, args []string) error {
		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)
		})

		if viper.GetBool(uiBrowserFlag) {
			openuri(addr)
		}
		fmt.Printf("Numary control is live on http://%s\n", addr)

		httpErr := http.ListenAndServe(addr, nil)
		if httpErr != nil && httpErr != http.ErrServerClosed {
			return httpErr
		}
		return 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, userOptions ...fx.Option) *fx.App

func NewDocCommand added in v1.3.0

func NewDocCommand() *cobra.Command

func NewDocFlagCommand added in v1.3.0

func NewDocFlagCommand() *cobra.Command

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 NewStorageDelete added in v1.3.2

func NewStorageDelete() *cobra.Command

func NewStorageInit

func NewStorageInit() *cobra.Command

func NewStorageList added in v1.3.2

func NewStorageList() *cobra.Command

func NewStorageScan added in v1.3.2

func NewStorageScan() *cobra.Command

func NewStorageUpgrade added in v1.3.2

func NewStorageUpgrade() *cobra.Command

func NewVersion

func NewVersion() *cobra.Command

func PrintVersion

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

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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