Help us shape the future of Go! Take the 2026 Go Developer Survey

start

package
v1.3.104-alpha1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package start cmd/dmsg/dmsg-server/commands/start/root.go c1-net-dmsg

Cobra entry point for `skywire dmsg server start`. Parses flags and the JSON config file into a dmsgsrv.Config, then hands off to pkg/services/dmsgsrv. The actual run loop lives there so the multi-service supervisor (`skywire svc run`) can host the same service from a JSON block.

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:     "start",
	Short:   "Start Dmsg Server",
	PreRunE: func(_ *cobra.Command, _ []string) error { return sf.Check() },
	Run: func(_ *cobra.Command, _ []string) {
		if _, err := buildinfo.Get().WriteTo(cmdutil.Stdout()); err != nil {
			log.Printf("Failed to output build info: %v", err)
		}

		logger := sf.Logger()

		var inner dmsgserver.Config
		if err := sf.ParseConfig(os.Args, true, &inner, configNotFound); err != nil {
			logger.WithError(err).Fatal("parsing config failed, generating default one...")
		}

		if inner.LogLevel != "" {
			logLvl, _, err := cmdutil.LevelFromString(inner.LogLevel)
			if err != nil {
				logger.WithError(err).Warnf("bad log_level in config; using %q", logLvl)
			}
			logging.SetLevel(logLvl)
		}

		cfg := &dmsgsrv.Config{
			Config:         inner,
			AuthPassphrase: authPassphrase,
			PProfMode:      pprofMode,
			PProfAddr:      pprofAddr,
			MetricsAddr:    sf.MetricsAddr,
		}

		stopPProf := dmsgcmdutil.InitPProf(logger, cfg.PProfMode, cfg.PProfAddr)
		defer stopPProf()

		ctx, cancel := cmdutil.SignalContext(context.Background(), logger)
		defer cancel()
		if err := dmsgsrv.New(cfg, logger).Run(ctx); err != nil {
			logger.WithError(err).Fatal("dmsg-server: run failed")
		}
	},
}

RootCmd contains commands for dmsg-server

Functions

func Execute

func Execute()

Execute executes root CLI command.

Types

This section is empty.

Jump to

Keyboard shortcuts

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