tunnel

package
v0.5.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateLocalPort

func CalculateLocalPort(remotePort int) (int, error)

CalculateLocalPort converts a remote port to a 5-digit local port. It prefixes "1" or "10" based on the port number. Calculate default Local port from defaultRemotePort. So 3306 would become 13306 and 5006 would become 15006. Take the port number and concat 1 or 10 to it so it becomes 5-digit 3306 -> 13306 5006 -> 15006 22 -> 10022 80 -> 10080

func GetBastionHostConfig

func GetBastionHostConfig(bastionHostID string) (config.Atun, error)

GetBastionHostConfig Gets bastion host tags and unmarshalls it into a struct

func GetBastionHostID added in v0.5.1

func GetBastionHostID() (string, error)

GetBastionHostID retrieves the Bastion Host ID from AWS tags. It takes a session, tag name, and tag value as parameters and returns the instance ID of the Bastion Host.

func RenderTunnelStatusTable

func RenderTunnelStatusTable(status bool, rows [][]string) error

RenderTunnelStatusTable creates and renders a custom table with a given header and rows. It can be reused throughout the project.

func SetAWSCredentials

func SetAWSCredentials(sess *session.Session) error

func StartTunnel

func StartTunnel(app *config.Atun) (bool, [][]string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳