sshutils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(bastionEndpoints ...EndpointIface) error

func GenerateKeys

func GenerateKeys() (string, string, error)

func Tunnel

func Tunnel(localPort int, remoteHost EndpointIface, bastionHost EndpointIface) error

Types

type EC2Endpoint

type EC2Endpoint struct {
	InstanceID string
	Port       int
	User       string
	PrivateKey string
	PublicKey  string
	UsePrivate bool

	Instance      *ec2types.Instance
	EC2Client     *ec2.Client
	ConnectClient *connect.Client
}

func NewEC2Endpoint

func NewEC2Endpoint(ctx context.Context, InstanceID string, ec2Client *ec2.Client, connectClient *connect.Client) (*EC2Endpoint, error)

func (*EC2Endpoint) GetSSHConfig

func (e *EC2Endpoint) GetSSHConfig() (*ssh.ClientConfig, error)

func (*EC2Endpoint) String

func (e *EC2Endpoint) String() string

type Endpoint

type Endpoint struct {
	Host       string
	Port       int
	User       string
	PrivateKey string
	PublicKey  string
}

func NewEndpoint

func NewEndpoint(s string) *Endpoint

func (*Endpoint) GetSSHConfig

func (e *Endpoint) GetSSHConfig() (*ssh.ClientConfig, error)

func (*Endpoint) String

func (e *Endpoint) String() string

type EndpointIface

type EndpointIface interface {
	String() string
	GetSSHConfig() (*ssh.ClientConfig, error)
}

Jump to

Keyboard shortcuts

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