bridge

package
v0.20.5 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cli.Command{
	Name:  "bridge",
	Usage: "open Kubernetes dashboard",

	Flags: []cli.Flag{
		app.ScopeFlag,
		app.NamespacesFlag,
	},

	Action: func(ctx context.Context, cmd *cli.Command) error {
		client := app.MustClient(ctx, cmd)

		port, err := system.FreePort(8888)

		if err != nil {
			return err
		}

		srv, err := bridge.New(client, nil)

		if err != nil {
			return err
		}

		url := fmt.Sprintf("http://localhost:%d", port)
		addr := fmt.Sprintf("localhost:%d", port)

		time.AfterFunc(500*time.Millisecond, func() {
			cli.Infof("Bridge on %s", url)
			cli.OpenURL(url)
		})

		return srv.ListenAndServe(ctx, addr)
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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