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

commands

package
v1.3.97 Latest Latest
Warning

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

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

Documentation

Overview

Package commands cmd/dmsg/pty-ui/commands/pty-ui.go c1-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)
		logrus.
			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()
		logrus.
			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