connect

package
v2.65.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecCmd

func ExecCmd(ctx context.Context, cmd *exec.Cmd) (exitCode int, err error)

ExecCmd runs the child process of a connect session. On unix, SIGINT/SIGTERM received while the session is running are forwarded to the child process, so an interrupted session (e.g. Ctrl-C during `kubectl get pods -w`) terminates the child and returns through the command's cleanup (e.g. temporary kubeconfig removal). A child killed by a signal exits with 128+signal, the shell convention.

func RenderCommand

func RenderCommand(tmpl string, data any) ([]string, error)

RenderCommand renders a Go text/template into a command line using the given data. The rendered output is split with shlex (quotes honored) and executed directly, without any shell.

Types

type TemplateData

type TemplateData struct {
	// contains filtered or unexported fields
}

TemplateData is the base template data for connect commands, embedded by each namespace's connect command which adds its own template values. Organization and Project are resolved lazily: the API is only called when the template references {{.Organization}} or {{.Project}} (Go templates invoke no-arg methods at the point of use).

func NewTemplateData

func NewTemplateData(ctx context.Context) *TemplateData

func (*TemplateData) Organization

func (d *TemplateData) Organization() (*iam.Organization, error)

Organization returns the default organization.

func (*TemplateData) Project

func (d *TemplateData) Project() (*account.Project, error)

Project returns the default project.

Jump to

Keyboard shortcuts

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