ssm

package
v0.0.0-...-7161f1f Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

README

Package cloudeng.io/aws/ssm

import cloudeng.io/aws/ssm

Types

Type Session
type Session struct {
	// contains filtered or unexported fields
}

Session represents an active SSM port forwarding session. It provides access to the local port that is being forwarded to the remote host.

Functions
func NewPortForwardingSession(ctx context.Context, pfi ssmclient.PortForwardingInput) (*Session, error)

NewPortForwardingSession starts a new SSM port forwarding session based on the provided input parameters. The underlying forwarding call runs in a goroutine so the caller is not blocked. Note that the tunnel will be ready to accept connections when NewPortForwardingSession returns. If LocalPort is not specified in the input, a free local port will be automatically allocated and used for the session. The caller can retrieve the local port being used via the LocalPort method.

The session can be closed by canceling the supplied context.

Methods
func (s *Session) LocalPort() int

LocalPort returns the local port that is being forwarded to the remote host. Clients can connect to this port to access the remote service through the SSM tunnel.

func (s *Session) Wait(ctx context.Context, duration time.Duration) error

Wait blocks until the session ends and returns any error that occurred during forwarding. A nil error means the session was closed cleanly (typically because the context was cancelled).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

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

Session represents an active SSM port forwarding session. It provides access to the local port that is being forwarded to the remote host.

func NewPortForwardingSession

func NewPortForwardingSession(ctx context.Context, pfi ssmclient.PortForwardingInput) (*Session, error)

NewPortForwardingSession starts a new SSM port forwarding session based on the provided input parameters. The underlying forwarding call runs in a goroutine so the caller is not blocked. Note that the tunnel will be ready to accept connections when NewPortForwardingSession returns. If LocalPort is not specified in the input, a free local port will be automatically allocated and used for the session. The caller can retrieve the local port being used via the LocalPort method.

The session can be closed by canceling the supplied context.

func (*Session) LocalPort

func (s *Session) LocalPort() int

LocalPort returns the local port that is being forwarded to the remote host. Clients can connect to this port to access the remote service through the SSM tunnel.

func (*Session) Wait

func (s *Session) Wait(ctx context.Context, duration time.Duration) error

Wait blocks until the session ends and returns any error that occurred during forwarding. A nil error means the session was closed cleanly (typically because the context was cancelled).

Jump to

Keyboard shortcuts

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