commands

package
v1.3.112 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package commands cmd/dmsg/pty-ui/commands/pty-ui.go c3-net-dmsg

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   dmsgclient.ExecName(),
	Short: "DMSG pseudoterminal GUI",
	Long: `
	┌┬┐┌┬┐┌─┐┌─┐┌─┐┌┬┐┬ ┬   ┬ ┬┬
	 │││││└─┐│ ┬├─┘ │ └┬┘───│ ││
	─┴┘┴ ┴└─┘└─┘┴   ┴  ┴    └─┘┴
  ` + "DMSG pseudoterminal GUI",
	Run: func(_ *cobra.Command, _ []string) {
		if _, err := buildinfo.Get().WriteTo(log.Writer()); err != nil {
			log.Printf("Failed to output build info: %v", err)
		}

		ui := pty.NewUI(pty.NetUIDialer(hostNet, hostAddr), conf)
		logging.StandardLogger().
			WithField("addr", addr).
			Info("Serving.")

		srv := &http.Server{
			ReadTimeout:       3 * time.Second,
			WriteTimeout:      3 * time.Second,
			IdleTimeout:       30 * time.Second,
			ReadHeaderTimeout: 3 * time.Second,
			Addr:              addr,
			Handler:           ui.Handler(nil),
		}

		err := srv.ListenAndServe()
		logging.StandardLogger().
			WithError(err).
			Info("Stopped serving.")
	},
}

RootCmd contains commands to start a dmsgpty-ui server for a dmsgpty-host

Functions

func Execute

func Execute()

Execute executes the root command.

Types

This section is empty.

Jump to

Keyboard shortcuts

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