ports

package
v0.6.335 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package ports displays Brev-managed public port mappings for an instance or external node.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdClosePort

func NewCmdClosePort(portStore Store) *cobra.Command

NewCmdClosePort creates the `brev ports close` command.

func NewCmdCreatePort

func NewCmdCreatePort(portStore Store) *cobra.Command

NewCmdCreatePort creates the `brev ports create` 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 registered compute node 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 registered compute node and creates an authenticated or public HTTP application endpoint.

func Run

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

Run resolves a managed instance or registered compute node 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"`
	// contains filtered or unexported fields
}

PortInfo is the stable JSON representation of a port mapping.

type Store

type Store interface {
	cmdutil.WorkspaceOrNodeResolver
}

Store contains the dependencies needed to resolve both managed instances and registered compute nodes.

Jump to

Keyboard shortcuts

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