ports

package
v0.6.337 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 17 Imported by: 1 module, 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

Overview

Package ports displays Brev-managed public port mappings for an instance or Brev Connect machine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get added in v0.6.336

func Get(
	ctx context.Context,
	out io.Writer,
	portStore Store,
	portID string,
	jsonOutput bool,
) error

Get resolves a port by its exact ID and displays all of its data.

func NewCmdClosePort

func NewCmdClosePort(portStore Store) *cobra.Command

NewCmdClosePort creates the `brev ports remove` command.

func NewCmdCreatePort

func NewCmdCreatePort(portStore Store) *cobra.Command

NewCmdCreatePort creates the `brev ports open` command.

func NewCmdGetPort added in v0.6.336

func NewCmdGetPort(portStore Store) *cobra.Command

NewCmdGetPort creates the `brev ports get` command.

func NewCmdPorts

func NewCmdPorts(portStore Store) *cobra.Command

NewCmdPorts creates the `brev ports` command group.

func NewCmdPortsLs

func NewCmdPortsLs(portStore Store) *cobra.Command

NewCmdPortsLs creates the `brev ports ls` command.

func NewCmdUpdatePort

func NewCmdUpdatePort(portStore Store) *cobra.Command

NewCmdUpdatePort creates the `brev ports update` command.

func Open

func Open(
	ctx context.Context,
	out io.Writer,
	portStore Store,
	nameOrID string,
	portNumber int32,
	protocol devplanev1.PortProtocol,
	allowedSources []string,
	jsonOutput bool,
) error

Open resolves a managed instance or Brev Connect machine and opens a port.

func OpenHTTP

func OpenHTTP(
	ctx context.Context,
	out io.Writer,
	portStore Store,
	nameOrID string,
	portNumber int32,
	httpProtocol devplanev1.HttpPortProtocol,
	customHostname string,
	authorizedEmails []string,
	allowPublicUnauthenticated bool,
	jsonOutput bool,
) error

OpenHTTP resolves a managed instance or Brev Connect machine and creates an authenticated or public HTTP application endpoint.

func OpenSequential added in v0.6.336

func OpenSequential(
	ctx context.Context,
	out io.Writer,
	portStore Store,
	nameOrID string,
	fromPort int32,
	toPort int32,
	protocol devplanev1.PortProtocol,
	allowedSources []string,
	jsonOutput bool,
) error

OpenSequential resolves a managed instance or Brev Connect machine and opens an inclusive range whose public ports are allocated sequentially.

func Run

func Run(ctx context.Context, out io.Writer, portStore Store, nameOrID string, jsonOutput bool) error

Run resolves a managed instance or Brev Connect machine and displays its ports.

Types

type PortInfo

type PortInfo struct {
	PortID                     string   `json:"port_id"`
	Endpoint                   string   `json:"endpoint"`
	PublicPort                 int32    `json:"public_port"`
	DestinationPort            int32    `json:"destination_port"`
	Protocol                   string   `json:"protocol"`
	AllowedSources             []string `json:"allowed_sources"`
	AuthorizedEmails           []string `json:"authorized_emails"`
	AllowPublicUnauthenticated bool     `json:"allow_public_unauthenticated"`
	Type                       string   `json:"type"`
}

PortInfo is the stable JSON representation of a port mapping.

type Store

type Store interface {
	cmdutil.WorkspaceOrNodeResolver
	GetContextWorkspaces() ([]entity.Workspace, error)
}

Store contains the dependencies needed to resolve both managed instances and Brev Connect machines.

Jump to

Keyboard shortcuts

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